home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / CW-ASM.DOC < prev    next >
Text File  |  1994-01-16  |  99KB  |  2,630 lines

  1. CauseWay for Assembly Language pre-release documentation
  2.  
  3. ---
  4.  
  5. Copyright 1992-1993 by Michael Devore and John Wildsmith.  All rights
  6. reserved.
  7.  
  8. All company and/or product names are trademarks and/or registered
  9. trademarks of their respective holders.
  10.  
  11. Last document revision 11/13/93, Michael Devore.  Information contained
  12. within this document is subject to change without notice.
  13.  
  14.  
  15.  
  16. CAUSEWAY LICENSE AGREEMENT
  17. ==========================
  18.  
  19. Michael Devore and John Wildsmith, the CauseWay authors, authorize you
  20. to make archival copies of CauseWay only for the purpose of backing up
  21. your software and thus protecting your investment.  You are bound by
  22. this agreement to ensure that no unauthorized copies of CauseWay are
  23. distributed, installed, or used in any manner.  Treat your copy of
  24. CauseWay much like a book; you can use it anywhere but only in one
  25. place at a time.
  26.  
  27. CauseWay carries a copyright (Copyright 1992-1993) by Michael Devore
  28. and John Wildsmith.  Use of code or proprietary algorithms within
  29. CauseWay, or disassembly of CauseWay code for purposes of using its
  30. code or determining the nature of its algorithms for use in competition
  31. with CauseWay, is an infringement of CauseWay's copyright.  All
  32. copyright infringements will be prosecuted to the fullest extent of the
  33. law.
  34.  
  35.  
  36.  
  37. CAUSEWAY WARRANTY
  38. =================
  39.  
  40. Michael Devore and John Wildsmith warrant the CauseWay material to be
  41. free from physical defects in material and workmanship for a period of
  42. ninety (90) days from date of purchase.  If a defect occurs during this
  43. period, you may return the faulty material and it will be replaced free
  44. of charge.
  45.  
  46. Michael Devore and John Wildsmith grant no other warranties, express or
  47. implied, regarding CauseWay's fitness for any application, use, or
  48. purpose.  Under no conditions will Michael Devore or John Wildsmith be
  49. held liabl for any special or consequential damages, either in contract
  50. or tort, arising out of use of, or inability to use, CauseWay.
  51.  
  52. This license agreement and warranty is governed by the laws of the
  53. State of Illinois.
  54.  
  55.  
  56.  
  57. RETURN POLICY
  58. =============
  59.  
  60. Should you experience a problem using CauseWay, the developers want to
  61. know.  If they cannot resolved the problem to your satisfaction, they
  62. do not expect you to spend money for a product you cannot use.  If you
  63. are dissatisfied with the operation of CauseWay for any reason and have
  64. not redistributed applications which use CauseWay, you may return the
  65. CauseWay package for a full refund of purchase price.  The developers
  66. would rather lose a sale than have a dissatisfied customer.
  67.  
  68.  
  69.  
  70.      ==========
  71.       OVERVIEW
  72.      ==========
  73.  
  74.  
  75.  
  76. INTRODUCTION
  77. ============
  78.  
  79. What Is CauseWay?
  80.  
  81. CauseWay is a 386 DOS extender package for use with assembly language
  82. programs.  It consists of a DOS extender and a protected mode linker,
  83. bound together in one executable file (WL32.EXE), as well as several
  84. support utilities.
  85.  
  86. CauseWay provides a simple method of allowing 16-bit DOS environments
  87. to support very large memory models for applications on PC compatibles
  88. with an 80386SX processor or above.  To do this, the DOS extender runs
  89. CauseWay processed applications in protected mode, rather than the real
  90. mode normally used in the DOS environment.  Support for both 16-bit and
  91. 32-bit protected mode applications operating under a DOS environment is
  92. provided.  CauseWay makes full use of 386-level chip capabilities
  93. including demand paging of code and data, variable-sized segments up to
  94. 4G in length, mixed 16- and 32-bit segments within the same program, as
  95. well as supporting the flat, nonsegmented, or NEAR addressing model.
  96.  
  97. Applications created using CauseWay are compatible with the VCPI & DPMI
  98. standards, as well as with systems with no other protected mode
  99. programs running.  This means that CauseWay applications will work with
  100. DesqView, Windows 3.0 and above in all three modes, as well as DOS
  101. windows within OS/2 2.0 and above.  CauseWay allocates extended memory
  102. from DPMI, VCPI, XMS, and INT 15h.  Any available conventional memory
  103. is also allocated.  The created application can then allocate memory
  104. using CauseWay's services without the need to detect or use any other
  105. memory type.
  106.  
  107. The primary concern during development of CauseWay was to ensure
  108. minimum effort would be needed by programmers to adapt their code to
  109. work with the CauseWay DOS extender.  As a result, many real mode
  110. programs only need to be re-linked with WL32 to produce a 16-bit
  111. protected mode version. Full advantage of CauseWay's capabilities can
  112. only be realized by producing 32-bit programs, but CauseWay's ability
  113. to mix 16 and 32-bit code should ensure that this transition is as
  114. painless as possible.
  115.  
  116.  
  117.  
  118. MINIMUM SYSTEM REQUIREMENTS
  119. ===========================
  120.  
  121. CauseWay requires a 386SX based computer or better and 250K free
  122. conventional memory.  The required operating environment is
  123. MS-DOS or PC-DOS 3.1 or higher, Windows 3.0 or higher, or OS/2
  124. 2.0 within a DOS window.
  125.  
  126.  
  127.  
  128. ENVIRONMENT VARIABLES
  129. =====================
  130.  
  131. CauseWay can make use of four environment variables.
  132.  
  133. The WL32 protected mode linker will use two environment variables when
  134. linking: OBJ and LIB.
  135.  
  136. OBJ Environment Variable
  137. ------------------------
  138.  
  139. The OBJ environment variable contains the name of one or more
  140. directories that are used if WL32 does not find an object module in the
  141. current directory.  The OBJ environment variable is identical to the
  142. LIB environment variable except WL32 searches for object modules with
  143. the OBJ environment variable instead of searching library files.
  144.  
  145. For example, assume your current directory is C:\ASMWORK.  The
  146. following command links DISPLAY.OBJ and DRIVER.OBJ with SA.LIB:
  147.  
  148. WL32 DISPLAY DRIVER,,,SA
  149.  
  150. Without an OBJ environment variable, if DISPLAY.OBJ or DRIVER.OBJ are
  151. not in the C:\ASMWORK directory, WL32 issues a DOS error 2 (file not
  152. found) error.  To specify that object modules may also be found in the
  153. \ASMWORK\SUPPORT directory on the current drive or the \HARDWARE directory
  154. on the F drive, set the OBJ environment variable as follows:
  155.  
  156. SET OBJ=\ASMWORK\SUPPORT;F:\HARDWARE
  157.  
  158. If DISPLAY.OBJ or DRIVER.OBJ are not found in the C:\ASMWORK directory,
  159. WL32 will also search the current drive's \ASMWORK\SUPPORT directory
  160. and the F drive's \HARDWARE directory for the object modules.
  161.  
  162.  
  163. LIB Environment Variable
  164. ------------------------
  165.  
  166. The LIB environment variable contains the name of one or more
  167. directories that are used if WL32 does not find a library file in the
  168. current directory.  The LIB environment variable is identical to the
  169. OBJ environment variable except WL32 searches for library files with
  170. the LIB environment variable instead of searching library files.
  171.  
  172. To use the previous OBJ environment variable example, assume your
  173. current directory is C:\ASMWORK.  The following command links
  174. DISPLAY.OBJ and DRIVER.OBJ with SA.LIB:
  175.  
  176. WL32 DISPLAY DRIVER,,,SA
  177.  
  178. Without a LIB environment variable, if SA.LIB is not in the C:\ASMWORK
  179. directory, WL32 issues a DOS error 2 (file not found) error.  To
  180. specify that library files may also be found in the \SA or \LIB
  181. directories, set the LIB environment variable as follows:
  182.  
  183. SET LIB=\SA;\LIB
  184.  
  185. If SA.LIB is not found in the C:\ASMWORK directory, WL32 will also
  186. search the current drive's \SA and \LIB directories for the object
  187. modules.
  188.  
  189.  
  190. TEMP and TMP Environment Variables
  191. ----------------------------------
  192.  
  193. The DOS extender can make use of the TEMP or TMP environment variable
  194. when a CauseWay application is run.  This environment variable
  195. determines the directory, and optionally the drive, where a swap file
  196. is built by the virtual memory manager (VMM). The path indicated by
  197. TEMP will be used if both are present.  For example:
  198.  
  199. SET TMP=C:\SWAP
  200.  
  201. directs the DOS extender to create its swap file, if any, in the
  202. C:\SWAP directory.  Since WL32 itself contains the CauseWay DOS
  203. extender, you may use the TEMP or TMP environment variable to specify a
  204. swapfile directory when linking a program.
  205.  
  206. If neither of these environment variables are present then the current
  207. drive is used. If free drive space is less than physical memory
  208. available at startup then the VMM will be automatically disabled.
  209.  
  210.  
  211.  
  212. OPERATING CAUSEWAY
  213. ==================
  214.  
  215. Use of CauseWay follows the standard edit-compile/assemble-link
  216. programming cycle.  CauseWay applications are created by first
  217. assembling or compiling the CauseWay-compliant source code to produce
  218. object modules.  These object modules, and optionally support
  219. libraries, are then linked using the WL32 protected mode linker.  The
  220. linker automatically adds the DOS extender to the executable file
  221. created.
  222.  
  223. When your application is executed, CauseWay is loaded first by DOS.
  224. Once CauseWay has established the protected mode environment, your
  225. application is retrieved from the same .EXE file and executed.
  226.  
  227.  
  228.  
  229.      ==============
  230.       DOS EXTENDER
  231.      ==============
  232.  
  233.  
  234. WRITING CAUSEWAY-COMPLIANT PROGRAMS
  235. ===================================
  236.  
  237. Switching from programming in real mode to protected mode using
  238. CauseWay should be a simple process.  Most aspects of the DOS
  239. enviroment are retained and for simple programs little or no alteration
  240. to source code will be required.  With the exception of segment
  241. arithmetic and code segment variables you won't need to change the way
  242. you program unless you need to allocate memory in >1Meg chunks or
  243. install your own hardware interrupt handlers.
  244.  
  245. Because the segment registers in protected mode are actually an index
  246. into a table which holds the real segment information, protected mode
  247. segment register values cannot be used directly in math operations.
  248. There are API services to obtain the real address referenced by a
  249. segment register should this information be needed.
  250.  
  251. The most common alteration needed to get an existing application
  252. working under CauseWay is removal of the code to shrink the
  253. application's memory block. Because this needs segment arithmetic to
  254. work in real mode it cannot be used in protected mode. Fortunately you
  255. only need to remove the code, not rewrite it because CauseWay allocates
  256. a block of memory that contains your application exactly and does not
  257. need shrinking.
  258.  
  259. Segments in protected mode have several attributes which control their
  260. use. The most important aspect of this is whether the segment is code
  261. or data. Unlike real mode, a code segment can only be executed or read
  262. from and a data segment can be read only or read/write. This means that
  263. code segment variables will need special consideration before your
  264. application will work with CauseWay. You can either move all the
  265. variables into a data segment or use the API AliasSel service to
  266. allocate a data selector that referances the same memory region as the
  267. code segment and use the selector allocted to access your code segment
  268. variables instead of CS.
  269.  
  270. CauseWay supports several programing models, the simplest being 16-bit
  271. multi segment programs much the same as you would produce for real
  272. mode. A 32-bit version of the multi segment model is also supported
  273. which offers more efficient code if you use the extended registers a
  274. lot or need very large segments. The final model supported is refered
  275. to as 'NEAR', also commonly known as the 'flat' model. In this model
  276. only a single segment is used to contain code, data and stack. Combined
  277. with the related API services this model removes the complication of
  278. segment registers almost completely with all relevant API dynamic
  279. memory manipulation being specified using 32-bit near pointers.
  280.  
  281. It should be pointed out here that there are no instructions available
  282. to 32-bit applications that cannot also be used in a 16-bit
  283. application. The distinction between the two types of application
  284. relates to the default operation size of segments and the stack frame
  285. for interrupt handlers. In a 16-bit code segment use of the extended
  286. registers or dword variables requires a prefix byte to be added to the
  287. instruction code generated by the assembler, which both increases
  288. memory usage and slows the code down. It is still possible to form
  289. addresses >64k in 16-bit mode. Use of 16-bit registers or memory
  290. variables in a 32-bit segment has the same effect on code generation
  291. and speed.
  292.  
  293. String instructions such as MOVSB and the LOOP instruction behave
  294. differently in 16 and 32-bit code segments. In a 16-bit code segment
  295. SI, DI and CX are the default registers used whereas the defaults in a
  296. 32-bit code segment are ESI, EDI and ECX. These defaults can be changed
  297. for a single instruction using manual prefix byte generation. A "db
  298. 67h" before a MOVSB will change the address size (SI,DI or ESI,EDI) and
  299. a "db 66h" before a LOOP will change the iteration size (CX or ECX).
  300. Manual use of these prefix bytes makes it possible to perform the same
  301. operations in both modes and this difference between 16 and 32-bit code
  302. segments is another common cause of problems.
  303.  
  304. The CauseWay functions provided are based on the DPMI 1.0 specification
  305. and additionally offer enhancements not provided by DPMI. This means
  306. that %99 of the DPMI 1.0 functions are available to the CauseWay
  307. programmer in all systems providing access to lower level functions
  308. than the CauseWay API should they ever be needed.
  309.  
  310. Hardware interrupts are always reflected to protected mode handlers even
  311. when signaled during real mode operations ensuring that your protected
  312. mode applications always retain control without resorting to patching
  313. real mode interrupt vectors yourself. The remaining interrupts will be
  314. serviced via the vector table appropriate to the mode but the real to
  315. protected mode Call Back services can be used to provide real mode code
  316. with access to protected mode code, effectively allowing any interrupt
  317. to be re-signaled in protected mode.
  318.  
  319. With the exception of int's that require segment&|offset pointers as
  320. parameters, all interrupts can be issued as normal. The most common INT
  321. ?? API's that require segment&|offset pointers are intercepted by
  322. CauseWay to provide normal access to these services.  Any other real
  323. mode int services that require segment&|offset pointers can still be
  324. acessed using CauseWay's simulate real mode interrupt/far call
  325. services.
  326.  
  327. Unhandled exceptions will terminate the program with a register
  328. display dump to screen and a text file called CW.ERR.
  329.  
  330. If you add your own hardware interrupt handlers, such as the timer tick
  331. at vector 08h, any memory touched by the handler, including its code,
  332. must reside in locked memory (a locked stack will be provided by
  333. CauseWay). This limitation is imposed by DOS not being re-entrant and
  334. the simple fact that hardware interrupts can occur at any time,
  335. including during DOS activity which would prevent CauseWay's virtual
  336. memory manager accessing its swap file.  Locked memory will never be
  337. moved to the swap file.
  338.  
  339.  
  340. CAUSEWAY SERVICES
  341. =================
  342.  
  343. CauseWay provides an API for assembly language programmers as an
  344. extension of the DPMI API.  Programmers may include the file CW.INC in
  345. their program for easy access to this API through appropriately named
  346. functions.  Additional modules provide access to the CauseWay API for
  347. other languages.
  348.  
  349. CauseWay also provides a large number of the DPMI 1.0 API services on
  350. systems without a true DPMI server. The function numbers supported are
  351. as follows:
  352.  
  353. 0000h-0001h, 0003h, 0006h-000Ch, 0100h-0102h, 0200h-0205h, 0300h-0301h,
  354. 0303h-0304h, 0400h, 0500h-0503h, 0600h-0604h, 0702h-0703h, 0800h-0801h,
  355. 0900h-0902h.
  356.  
  357. CauseWay provides an API for asm programmers as an extension of the
  358. DPMI API. Additional modules provide access to the CauseWay API for
  359. other languages.
  360.  
  361. Some of the API services require pointers to a "real mode register
  362. list". The format of this list is as follows:
  363.  
  364.      dword  EDI
  365.      dword  ESI
  366.      dword  EBP
  367.      dword  Reserved
  368.      dword  EBX
  369.      dword  EDX
  370.      dword  ECX
  371.      dword  EAX
  372.      word   Flags
  373.      word   ES
  374.      word   DS
  375.      word   FS
  376.      word   GS
  377.      word   IP
  378.      word   CS
  379.      word   SP
  380.      word   SS
  381.  
  382. The values will be passed to the target routine without any
  383. interpretation of its contents so there is no need to set the high
  384. words of the extended register entries unless the target routine
  385. requires them.
  386.  
  387. Stack frames for 16 bit interrupts are the same as for real mode.
  388.  
  389. Stack frames for 32-bit interrupts use dword entries, eg,
  390.  
  391.      dword  EFlags
  392.      dword  CS, high word undefined.
  393.      dword  EIP
  394.  
  395. The default CauseWay API is as follows:
  396.  
  397.  
  398. Info        Get system selectors/flags.
  399.  
  400. Inputs:     AX= 0ff00h
  401.  
  402. Outputs:    AX= Selector for real mode segment address of 00000h, 4G limit.
  403.             BX= Selector for current PSP segment. 100h limit.
  404.             [E]CX= Dos transfer buffer size. Always <64k.
  405.             DX= Dos transfer buffer real mode segment address.
  406.             ES:[E]SI= Dos transfer buffer address. ESI+ECX ALWAYS <64k.
  407.             EDI= System flags. Bits significant if set.
  408.                  0 - 32 bit code default.
  409.                  1 - Virtual memory manager functional.
  410.                  2 \ Mode, 0 - raw, 1 - VCPI, 2 - DPMI.
  411.                  3 /
  412.                  4 - DPMI available.
  413.                  5 - VCPI available.
  414.                  6 - No memory managers.
  415.                  7 - Descriptor table type. 0 - GDT, 1 - LDT.
  416.                 15 - Debug engine present.
  417.  
  418. Errors:     None
  419.  
  420. Notes:      Bits 1-2 of DI indicate the interface type being used by
  421.             CauseWay.
  422.  
  423.             Bits 4-5 indicate the interface types that are
  424.             available.
  425.  
  426.             Bit 7 indicates the descriptor table being used to allocate
  427.             selectors to the application when on a raw/vcpi system. The
  428.             Dos transfer buffer is the area CauseWay uses to transfer
  429.             data between conventional and extended memory during DOS
  430.             interrupts.  This memory can be used as temporary work
  431.             space for your own access to real mode code as long as you
  432.             remember it may be over written the next time you issue an
  433.             INT in protected mode that requires segment&|offset pointers.
  434.  
  435.  
  436. IntXX       Simulate real mode interrupt.
  437.  
  438. Inputs:     AX= 0ff01h
  439.             BL= Interupt number.
  440.             ES:[E]DI= Real mode register list.
  441.  
  442. Outputs:    Register list updated.
  443.  
  444. Errors:     None.
  445.  
  446. Notes:      The real mode register list referenced by ES:[E]DI should
  447.             contain the register values you want passing to the real
  448.             mode interrupt handler.  The SS:SP & Flags entries are
  449.             filled in by CauseWay to ensure legal values are used and
  450.             the CS:IP entries are ignored. This function bypasses
  451.             protected mode interrupt handlers and provides access to
  452.             INT API's that require segment &| offset pointers.
  453.  
  454.  
  455. FarCallReal Simulate real mode far call.
  456.  
  457. Inputs:     AX= 0ff02h
  458.             ES:[E]DI= Real mode register list.
  459.  
  460. Outputs:    Register list updated.
  461.  
  462. Errors:     None.
  463.  
  464. Notes:      This function works much the same as IntXX but provides a
  465.             16 bit FAR stack frame and the CS:IP values are used to
  466.             pass control to the real mode code.
  467.  
  468.  
  469. GetCallBack Allocate real mode call back address.
  470.  
  471. Inputs:     AX= 0303h
  472.             DS:[E]SI= Call address.
  473.             ES:[E]DI= Real mode register structure.
  474.  
  475. Outputs:    Carry set on error, else,
  476.             CX:DX= Real mode address to trigger mode switch.
  477.  
  478. Errors:     CallBack's are a limited resource. There will normaly only
  479.             be 16 available per virtual machine so they should be used
  480.             carefully and released as soon as they are no longer
  481.             required.
  482.  
  483. Call-Back:  Interrupts disabled.
  484.             DS:[E]SI = Selector:Offset of real mode SS:SP.
  485.             ES:[E]DI = Selector:Offset of real mode call structure.
  486.             SS:[E]SP = Locked protected mode stack.
  487.             All other registers undefined
  488.  
  489.             To return from Call-Back Procedure,
  490.             Execute an IRET to return
  491.             ES:[E]DI =  Selector:Offset of real mode call structure to
  492.                         restore.
  493.  
  494. Notes:      Real mode CallBack's provide a means of switching from real
  495.             mode to protected mode. The address returned by this
  496.             function is a unique real mode address that when given
  497.             control in real mode will switch to protected mode and pass
  498.             control to the protected mode routine supplied at entry to
  499.             this function.  On entry to the protected mode code the
  500.             "Real mode register structure" will contain all the real
  501.             mode register values.
  502.  
  503.  
  504. RelCallBack Release a real mode call back entry.
  505.  
  506. Inputs:     AX= 0304h
  507.             CX:DX= Real mode address returned by GetCallBack
  508.  
  509. Outputs:    None.
  510.  
  511. Notes:      This function should be used to release CallBack addresses
  512.             once they are no longer needed.
  513.  
  514.  
  515. GetVect     Get Protected mode interrupt handler address.
  516.  
  517. Inputs:     AX= 0204h
  518.             BL= Interupt vector number.
  519.  
  520. Outputs:    CX:[E]DX= selector:offset of handler.
  521.  
  522. Errors:     None.
  523.  
  524.  
  525. SetVect     Set Protected mode interrupt handler address.
  526.  
  527. Inputs:     AX= 0205h
  528.             BL= Interupt vector number.
  529.             CX:[E]DX= selector:offset of new handler.
  530.  
  531. Outputs:    None.
  532.  
  533. Errors:     None.
  534.  
  535.  
  536. GetRVect    Get real mode interrupt handler address.
  537.  
  538. Inputs:     AX= 0200h
  539.             BL= Interupt vector number.
  540.  
  541. Outputs:    CX:DX= selector:offset of handler.
  542.  
  543. Errors:     None.
  544.  
  545.  
  546. SetRVect    Set real mode interrupt handler address.
  547.  
  548. Inputs:     AX= 0201h
  549.             BL= Interupt vector number.
  550.             CX:DX= selector:offset of new handler.
  551.  
  552. Outputs:    None.
  553.  
  554. Errors:     None.
  555.  
  556.  
  557. GetEVect    Get Protected mode exception handler address.
  558.  
  559. Inputs:     AX= 0202h
  560.             BL= Exception vector number.
  561.  
  562. Outputs:    Carry set on error else,
  563.             CX:[E]DX= selector:offset of handler.
  564.  
  565. Errors:     The number in BL must be in the range 0-1Fh.  Anything
  566.             outside this range will return carry set.
  567.  
  568.  
  569. SetEVect    Set Protected mode exception handler address.
  570.  
  571. Inputs:     AX= 0203h
  572.             BL= Exception vector number.
  573.             CX:[E]DX= selector:offset of new handler.
  574.  
  575. Outputs:    Carry set on error.
  576.  
  577. Errors:     The number in BL must be in the range 0-1Fh. Anything
  578.             outside this range will return carry set.
  579.  
  580.  
  581. GetSel      Allocate a new selector.
  582.  
  583. Inputs:     AX= 0ff03h
  584.  
  585. Outputs:    Carry set on error else,
  586.             BX= Selector.
  587.  
  588. Errors:     Approximatly 8192 selectors are initially available.  This
  589.             is quite a lot but it is obviously possible to run out.
  590.  
  591. Notes:      A selector is allocated and initialised with a base of 0, a
  592.             limit of 0 and as read/write expand up data. Use SetSelDet
  593.             to make the selector useful.
  594.  
  595.  
  596. RelSel      Release a selector.
  597.  
  598. Inputs:     AX= 0ff04h
  599.             BX= Selector.
  600.  
  601. Outputs:    Carry set on error.
  602.  
  603. Errors:     If an invalid selector is passed in BX this function will
  604.             return with carry set.
  605.  
  606. Notes:      Use this function to release selectors allocated by GetSel
  607.             or AliasSel.
  608.  
  609.  
  610. CodeSel     Make a selector execute/read type.
  611.  
  612. Inputs:     AX= 0ff05h
  613.             BX= Selector.
  614.             CL= Default operation size. (0=16 bit,1=32 bit)
  615.  
  616. Outputs:    Carry set on error.
  617.  
  618. Errors:     If an invalid selector is passed in BX this function will
  619.             return with carry set.
  620.  
  621. Notes:      Allows a selector to be converted to a type suitable for
  622.             execution.
  623.  
  624.  
  625. AliasSel    Create a read/write data selector from source selector.
  626.  
  627. Inputs:     AX= 0ff06h
  628.             BX= Source selector
  629.  
  630. Outputs:    Carry set on error else,
  631.             AX= New data selector
  632.  
  633. Errors:     If an invalid selector is passed in BX this function will
  634.             return with carry set.
  635.  
  636. Notes:      This function always creates a read/write data selector
  637.             regardless of the source selector's type. Can be used to
  638.             provide access to variables in a code segment.
  639.  
  640.  
  641. GetSelDet   Get selector linear base and limit.
  642.  
  643. Inputs:     Carry set on error else,
  644.             AX= 0ff07h
  645.             BX= Selector
  646.  
  647. Outputs:    Carry set on error else,
  648.             CX:DX= Linear base.
  649.             SI:DI= Byte granular limit.
  650.  
  651. Errors:     If an invalid selector is passed in BX this function will
  652.             return with carry set.
  653.  
  654.  
  655. GetSelDet32 Get selector linear base and limit.
  656.  
  657. Inputs:     AX= 0ff08h
  658.             BX= Selector
  659.  
  660. Outputs:    Carry set on error else,
  661.             EDX= Linear base.
  662.             ECX= Byte granular limit.
  663.  
  664. Errors:     If an invalid selector is passed in BX this function will
  665.             return with carry set.
  666.  
  667.  
  668. SetSelDet   Set selector linear base and limit.
  669.  
  670. Inputs:     AX= 0ff09h
  671.             BX= Selector.
  672.             CX:DX= Linear base.
  673.             SI:DI= Byte granular limit.
  674.  
  675. Outputs:    Carry set on error.
  676.  
  677. Errors:     If an invalid selector is passed in BX this function will
  678.             return with carry set.
  679.  
  680.  
  681. SetSelDet32 Set selector linear base and limit.
  682.  
  683. Inputs:     AX= 0ff0ah
  684.             BX= Selector.
  685.             EDX= Linear base.
  686.             ECX= Byte granular limit.
  687.  
  688. Outputs:    Carry set on error.
  689.  
  690. Errors:     If an invalid selector is passed in BX this function will
  691.             return with carry set.
  692.  
  693.  
  694. GetMem      Allocate a block of memory.
  695.  
  696. Inputs:     AX= 0ff0bh
  697.             CX:DX= Size of block required in bytes. (-1:-1 to get
  698.                    maximum memory size)
  699.  
  700. Outputs:    Carry set on error else,
  701.             BX= Selector to access the block with.
  702.             or if CX:DX was -1, CX:DX= size of largest block available.
  703.  
  704. Errors:     The amount of memory available is limited by physical
  705.             memory present and free disk space of the drive being used
  706.             by the VMM.  If CauseWay is unable to find a large enough
  707.             block this function will return carry set.
  708.  
  709. Notes:      This function allocates a block of extended (application)
  710.             memory, and also a selector with a suitable base & limit.
  711.  
  712.  
  713. GetMem32    Allocate a block of memory.
  714.  
  715. Inputs:     AX= 0ff0ch
  716.             ECX= Size of block required in bytes. (-1 to get maximum
  717.                  memory size)
  718.  
  719. Outputs:    Carry set on error else,
  720.             BX= Selector to access the block with.
  721.             or if ECX was -1, ECX= size of largest block available.
  722.  
  723. Errors:     See GetMem
  724.  
  725. Notes:      This function allocates a block of extended (application)
  726.             memory, and also a selector with a suitable base & limit.
  727.  
  728.  
  729. ResMem     Resize a previously allocated block of memory.
  730.  
  731. Inputs:     AX= 0ff0dh
  732.             BX= Selector for block.
  733.             CX:DX= New size of block required in bytes.
  734.  
  735. Outputs:    Carry set on error.
  736.  
  737. Errors:     If an invalid selector is passed in BX or not enough memory
  738.             is available when increasing the block size then this
  739.             function will return carry set.
  740.  
  741. Notes:      If the memory block can't be resized in its current
  742.             location, but a free block of memory of the new size
  743.             exists, the memory will be copied to a new block and the
  744.             old one released. This is transparent to the application as
  745.             long as only the selector origionaly allocated with GetMem
  746.             is being used to access the memory.
  747.  
  748.  
  749. ResMem32    Resize a previously allocated block of memory.
  750.  
  751. Inputs:     AX= 0ff0eh
  752.             BX= Selector for block.
  753.             ECX= New size of block required in bytes.
  754.  
  755. Outputs:    Carry set on error.
  756.  
  757. Errors:     See ResMem
  758.  
  759. Notes:      If the memory block can't be resized in its current
  760.             location, but a free block of memory of the new size
  761.             exists, the memory will be copied to a new block and the
  762.             old one released. This is transparent to the application as
  763.             long as only the selector originally allocated with GetMem
  764.             is being used to access the memory.
  765.  
  766.  
  767. RelMem      Release memory allocated by either GetMem or GetMem32.
  768.  
  769. Inputs:     AX= 0ff0fh
  770.             BX= Selector for block to release.
  771.  
  772. Outputs:    Carry set on error.
  773.  
  774. Errors:     If an invalid selector is passed in BX or the memory was
  775.             not allocated via GetMem or GetMem32 this function will
  776.             return carry set.
  777.  
  778.  
  779. GetMemLinear    Allocate a block of memory without a selector.
  780.  
  781. Inputs:     AX= 0ff10h
  782.             CX:DX= Size of block required in bytes.
  783.  
  784. Outputs:    Carry set on error else,
  785.             SI:DI= Linear address of block allocated.
  786.  
  787. Errors:     If not enough memory is available to satisfy the request
  788.             then this function will return carry set.
  789.  
  790. Notes:      Addresses returned by this function may be >16M
  791.  
  792.  
  793. GetMemLinear32 Allocate a block of memory without a selector.
  794.  
  795. Inputs:     AX= 0ff11h
  796.             ECX= Size of block required in bytes.
  797.  
  798. Outputs:    Carry seet on error else,
  799.             ESI= Linear address of block allocated.
  800.  
  801. Errors:     See GetMemLinear
  802.  
  803. Notes:      Addresses returned by this function may be >16M
  804.  
  805.  
  806. ResMemLinear    Resize a previously allocated block of memory without a
  807.                 selector.
  808.  
  809. Inputs:     AX= 0ff12h
  810.             SI:DI= Linear address of block to resize.
  811.             CX:DX= Size of block required in bytes.
  812.  
  813. Outputs:    Carry set on error else,
  814.             SI:DI= New linear address of block.
  815.  
  816. Errors:     If not enough memory is available when extending the block
  817.             size this function will return carry set.
  818.  
  819. Notes:      If the memory block cannot be expanded to the desired size,
  820.             and a free block of sufficient size exists, the existing
  821.             memory will be copied to the free block and released, the
  822.             new block then being alocated in place of the old.
  823.  
  824.  
  825. ResMemLinear32  Resize a previously allocated block of memory without a
  826.                 selector.
  827.  
  828. Inputs:     AX= 0ff13h
  829.             ESI= Linear address of block to resize.
  830.             ECX= Size of block required in bytes.
  831.  
  832. Outputs:    Carry set on error else,
  833.             ESI= New linear address of block.
  834.  
  835. Errors:     See ResMemLinear
  836.  
  837. Notes:      If the memory block cannot be expanded to the desired size,
  838.             and a free block of sufficient size exists, the existing
  839.             memory will be copied to the free block and released, the
  840.             new block then being alocated in place of the old.
  841.  
  842.  
  843. RelMemLinear    Release previously allocated block of memory (linear
  844.                 address).
  845.  
  846. Inputs:     AX= 0ff14h
  847.             SI:DI= Linear address of block to release.
  848.  
  849. Outputs:    Carry set on error.
  850.  
  851. Errors:     If the address passed in SI:DI is not a valid memory block
  852.             this function will return carry set.
  853.  
  854.  
  855. RelMemLinear32  Release previously allocated block of memory (linear
  856.                 address).
  857.  
  858. Inputs:     AX= 0ff15h
  859.             ESI= Linear address of block to release.
  860.  
  861. Outputs:    Carry set on error.
  862.  
  863. Errors:     See RelMemLinear
  864.  
  865.  
  866. GetMemNear  Allocate an application relative block of memory.
  867.  
  868. Inputs:     AX= 0ff16h
  869.             EBX= Size of block required in bytes.
  870.  
  871. Outputs:    Carry set on error else,
  872.             ESI= Application relative linear address of block allocated.
  873.  
  874. Errors:     If there is not enough memory available to satisfy the
  875.             request then this function will return carry set.
  876.  
  877. Notes:      Addresses returned by this function are as an offset from
  878.             the start of the applications memory and is intended to be
  879.             used with the "NEAR" memory  model.
  880.  
  881.  
  882. ResMemNear  Resize a previously allocated application relative
  883.             block of memory.
  884.  
  885. Inputs:     AX= 0ff17h
  886.             EBX= Size of block required in bytes.
  887.             ESI= application relative linear address of block to resize.
  888.  
  889. Outputs:    Carry set on error else,
  890.             ESI= New application relative linear address of block.
  891.  
  892. Errors:     If the address passed in ESI is not a valid memory block or
  893.             there is not enough memory available when expanding the
  894.             block this function will return carry set.
  895.  
  896. Notes:      If the memory block cannot be expanded to the desired size,
  897.             and a free block of sufficient size exists, the existing
  898.             memory will be copied to the free block and released, the
  899.             new block then being allocated in place of the old.
  900.  
  901.  
  902. RelMemNear  Release previously allocated application relative block of
  903.             memory.
  904.  
  905. Inputs:     AX= 0ff18h
  906.             ESI= Application relative linear address of block to release.
  907.  
  908. Outputs:    Carry set on error.
  909.  
  910. Errors:     If the address passed in ESI is not a valid memory block
  911.             this function will return carry set.
  912.  
  913.  
  914. Linear2Near Convert linear address to application relative address.
  915.  
  916. Inputs:     AX= 0ff19h
  917.             ESI= Linear address to convert.
  918.  
  919. Outputs:    ESI= Application relative linear address.
  920.  
  921. Errors:     None
  922.  
  923.  
  924. Near2Linear Convert application relative address to linear address.
  925.  
  926. Inputs:     AX= 0ff1ah
  927.             ESI= Application relative linear address.
  928.  
  929. Outputs:    ESI= Linear address.
  930.  
  931. Errors:     None
  932.  
  933.  
  934. LockMem     Lock a region of memory.
  935.  
  936. Inputs:     AX= 0ff1bh
  937.             BX:CX= Starting linear address of memory to lock.
  938.             SI:DI= Size of region to lock in bytes.
  939.  
  940. Outputs:    Carry set on error.
  941.  
  942. Errors:     If any of the region specified is invalid or if not enough
  943.             physical memory is available to fill the region specified
  944.             then none of the memory will be locked and this function
  945.             will return carry set.
  946.  
  947. Notes:      Memory that is locked cannot be swapped to disk by the VMM.
  948.             You should note that locking is applied to memory on 4k
  949.             boundaries, so areas of memory below and above the memory
  950.             being locked will also be locked if the specified region is
  951.             not 4K aligned.
  952.  
  953.  
  954. LockMem32   Lock a region of memory.
  955.  
  956. Inputs:     AX= 0ff1ch
  957.             ESI= Starting linear address of memory to lock.
  958.             ECX= Size of region to lock in bytes.
  959.  
  960. Outputs:    Carry set on error.
  961.  
  962. Errors:     See LockMem.
  963.  
  964. Notes:      Memory that is locked cannot be swapped to disk by the VMM.
  965.             You should note that locking is applied to memory on 4k
  966.             boundaries, so areas of memory below and above the memory
  967.             being locked will also be locked if the specified region is
  968.             not 4K aligned.
  969.  
  970.  
  971. UnLockMem   Unlock a region of memory.
  972.  
  973. Inputs:     AX= 0ff1dh
  974.             BX:CX= Starting linear address of memory to unlock
  975.             SI:DI= Size of region to unlock in bytes
  976.  
  977. Outputs:    Carry set on error.
  978.  
  979. Errors:     If any of the memory region specified is invalid this
  980.             function will return carry set.
  981.  
  982. Notes:      This will allow the memory to be swapped to disk by the VMM
  983.             if necessary.  Areas below and above the specified memory
  984.             will also be unlocked if the specified region is not page
  985.             aligned.
  986.  
  987.  
  988. UnLockMem32 Unlock a region of memory.
  989.  
  990. Inputs:     AX= 0ff1eh
  991.             ESI= Starting linear address of memory to unlock
  992.             ECX= Size of region to unlock in bytes
  993.  
  994. Outputs:    Carry set on error.
  995.  
  996. Errors:     See UnLockMem
  997.  
  998. Notes:      This will allow the memory to be swapped to disk by the VMM
  999.             if necessary.  Areas below and above the specified memory
  1000.             will also be unlocked if the specified region is not page
  1001.             aligned.
  1002.  
  1003.  
  1004. LockMemNear Lock a region of memory using application relative address.
  1005.  
  1006. Inputs:     AX= 0ff1fh
  1007.             ESI= Starting linear address of memory to lock.
  1008.             EBX= Size of region to lock in bytes.
  1009.  
  1010. Outputs:    Carry set on error.
  1011.  
  1012. Errors:     See LockMem
  1013.  
  1014. Notes:      Memory that is locked cannot be swapped to disk by the VMM.
  1015.             You should note that locking is applied to memory on 4k
  1016.             boundaries, so areas of memory below and above the memory
  1017.             being locked will also be locked if the specified region is
  1018.             not 4K aligned.
  1019.  
  1020.  
  1021. UnLockMemNear   Unlock a region of memory using application relative
  1022.                 address.
  1023.  
  1024. Inputs:     AX= 0ff20h
  1025.             ESI= Starting linear address of memory to unlock
  1026.             EBX= Size of region to unlock in bytes
  1027.  
  1028. Outputs:    Carry set on error.
  1029.  
  1030. Errors:     See UnLockMem
  1031.  
  1032. Notes:      This will allow the memory to be swapped to disk by the VMM
  1033.             if necessary.
  1034.  
  1035.             Areas below and above the specified memory will also be
  1036.             unlocked if the specified region is not page aligned.
  1037.  
  1038.  
  1039. GetMemDOS   Allocate a region of DOS (conventional) memory.
  1040.  
  1041. Inputs:     AX= 0ff21h
  1042.             BX= Number of paragraphs (16 byte blocks) required.
  1043.  
  1044. Outputs:    Carry set on error and BX= largest block size, AX=DOS error else,
  1045.             AX= Initial real mode segment of allocated block
  1046.             DX= Initial selector for allocated block
  1047.  
  1048. Errors:     If there are not enough selectors or memory available then
  1049.             this function will return carry set.
  1050.  
  1051. Notes:      If the size of the block requested is greater than 64K
  1052.             bytes (BX > 1000h) then contiguous descriptors will be
  1053.             allocated.  If more than one descriptor is allocated under
  1054.             32-bit applications, the limit of the first descriptor will
  1055.             be set to the size of the entire block.  All subsequent
  1056.             descriptors will have a limit of 64K except for the final
  1057.             descriptor which will have a limit of Block size MOD 64K.
  1058.             16-bit applications will always set the limit of the first
  1059.             descriptor to 64K.
  1060.  
  1061.  
  1062. ResMemDOS   Resize a block of DOS (conventional) memory allocated with
  1063.             GetMemDOS.
  1064.  
  1065. Inputs:     AX= 0ff22h
  1066.             BX= New block size in paragraphs
  1067.             DX= Selector of block to modify
  1068.  
  1069. Outputs:    Carry set on error, AX= DOS error code, BX= Maximum para
  1070.             block size.
  1071.  
  1072. Errors:     If an invalid block is passed or if not enough selectors or
  1073.             memory are available when expanding the block this function
  1074.             will return carry set.
  1075.  
  1076. Notes:      Growing a memory block is often likely to fail since other
  1077.             DOS block allocations will prevent increasing the size of
  1078.             the block.  Also, if the size of a block grows past a 64K
  1079.             boundary then the allocation will fail if the next
  1080.             descriptor in the LDT is not free.
  1081.  
  1082.  
  1083. RelMemDOS   Release a block of DOS (conventional) memory allocated by
  1084.             GetMemDOS.
  1085.  
  1086. Inputs:     AX= 0ff23h
  1087.             DX= Selector of block to free.
  1088.  
  1089. Outputs:    Carry set on error and AX= DOS error code.
  1090.  
  1091. Errors:     If an invalid block is passed this function will return
  1092.             carry set.
  1093.  
  1094. Notes:      All descriptors allocated for the memory block are
  1095.             automatically freed and therefore should not be accessed
  1096.             once the block is freed by this function.
  1097.  
  1098.  
  1099. ExecOverlay Load, relocate and optionally execute application
  1100.             code.
  1101.  
  1102. Inputs:     AX= 0fffdh
  1103.             EBX= Flags, bit significant if set.
  1104.                  0 - Don't execute.
  1105.                  1 - Don't preserve segment/relocation memory.
  1106.             ES:EDX= File name.
  1107.             FS:ESI= Command line. ESI=0 for none. First byte is length.
  1108.             GS:EDI= Name (/o:? option in CW). EDI=0 for none (Not used yet).
  1109.  
  1110. Outputs:    Carry set on error and AX= Error code else,
  1111.             If bit 1 of EBX was set on entry then:
  1112.                CX:EDX = Entry CS:EIP
  1113.                SI= PSP segment.
  1114.             if bit 0 set & bit 1 not set of EBX on entry:
  1115.                BX:EAX= entry SS:ESP
  1116.                EDI= High word - base segment, low word - number of segments.
  1117.                EBP= Start of segment definitions.
  1118.  
  1119. Errors:     1 - DOS file access error.
  1120.             2 - Not a CauseWay 3P file.
  1121.             3 - Not enough memory.
  1122.  
  1123.  
  1124. GetDOSTrans  Get current address and size of the buffer used for DOS
  1125.              memory transfers.
  1126.  
  1127. Inputs:   AX = 0ff25h
  1128.  
  1129. Outputs:  BX = Real mode segment of buffer.
  1130.           DX = Protected mode selector for buffer.
  1131.           ECX = Buffer size
  1132.  
  1133. Errors:   None
  1134.  
  1135. Notes:    This buffer is used by the built in INT API translation
  1136.           services, e.g., INT 21h, AH=40h (write to file). The default
  1137.           buffer is 8k and uses memory that would otherwise be wasted.
  1138.           This default is sufficient for most file I/O but if you are
  1139.           writing a program that reads/writes large amounts of data you
  1140.           should consider allocating your own larger buffer and pass
  1141.           the address to CauseWay to speed this file I/O.
  1142.  
  1143.  
  1144. SetDOSTrans  Set new address and size of the buffer used for DOS memory
  1145.              transfers.
  1146.  
  1147. Inputs:   AX = 0ff26h
  1148.           BX = Real mode segment of buffer.
  1149.           DX = Protected mode selector for buffer.
  1150.           ECX = Buffer size (should be <=64K)
  1151.  
  1152. Outputs:  None
  1153.  
  1154. Errors:   None
  1155.  
  1156. Notes:    The buffer must be in conventional memory and only the first
  1157.           64K will be used even if a bigger buffer is specified.
  1158.           CauseWay will automatically restore the previous buffer
  1159.           setting when the application terminates but GetDOSTrans can
  1160.           be used to get the current buffer's settings if you only want
  1161.           the change to be temporary.
  1162.  
  1163.           You can still use the default buffer for your own puposes
  1164.           even after setting a new address.
  1165.  
  1166. NOTES
  1167. -----
  1168.  
  1169. A fixed segment selector at 40h is always available to the application.
  1170. This selector maps the real mode memory at 400h where most of the BIOS
  1171. variables can be found. Their is a possibility of this selector being
  1172. dropped in future DPMI specifications so complete compatibility with
  1173. DPMI can only be ensured by allocating your own selector for this
  1174. memory region.
  1175.  
  1176. When not running under a DPMI server CauseWay provides selectors at
  1177. addresses 0B000h, 0B800h and 0A000h to ease conversion of real mode
  1178. code.
  1179.  
  1180. DS & ES are set to the programs PSP at entry. The environment variable
  1181. in the PSP is a valid protected mode selector.
  1182.  
  1183. CauseWay allocates a block of memory that contains the application and
  1184. its PSP exactly. It is not necesary to shrink the programs memory.
  1185.  
  1186. The application should terminate using int 21h function 4Ch. The error
  1187. level passed to this function will be returned to any parent programs
  1188. in the normal way.
  1189.  
  1190. If the application needs to TSR you can use int 21h function 31h but no
  1191. memory value is required, all memory owned by the application when the
  1192. TSR is issued will remain the programs property. You should note that
  1193. there is currently no way of removing the application from memory once
  1194. it is TSR.
  1195.  
  1196. Interrupt handlers in a 32-bit application will need to do an IRETD
  1197. rather than the normal IRET. I've not come across an assembler that
  1198. automatically generates the right size from a normal IRET instruction
  1199. yet.
  1200.  
  1201.  
  1202.  
  1203. INTERRUPT SERVICES EXTENDED OR ALTERED BY CAUSEWAY
  1204. ==================================================
  1205.  
  1206. The size of register used will depend on the limit of the selector
  1207. supplied.  Unspecified registers should be set up in the normal way.
  1208. INT API's not listed here that require segment &| offset pointers will
  1209. need to be handled using IntXX or your own interrupt translation code.
  1210.  
  1211. INT 10h
  1212. -------
  1213.  
  1214. 10h sub function 02h, [E]DX instead of DX.
  1215. 10h sub function 09h, [E]DX instead of DX.
  1216. 10h sub function 12h, [E]DX instead of DX.
  1217. 10h sub function 17h, [E]DX instead of DX.
  1218. 13h [E]BP instead of BP.
  1219. 1Ch sub function 01h, [E]BX instead of BX.
  1220. 1Ch sub function 02h, [E]BX instead of BX.
  1221.  
  1222.  
  1223. INT 21h
  1224. -------
  1225.  
  1226. 09h [E]DX instead of DX
  1227. 0Ah [E]DX instead of DX
  1228. 1Ah [E]DX instead of DX
  1229. 25h [E]DX instead of DX. Protected mode vector will be set.
  1230. 2Fh [E]BX instead of BX
  1231. 31h No value is required in DX.
  1232. 35h [E]BX instead of BX. Protected mode vector will be returned.
  1233. 39h [E]DX instead of DX
  1234. 3Ah [E]DX instead of DX
  1235. 3Bh [E]DX instead of DX
  1236. 3Ch [E]DX instead of DX
  1237. 3Dh [E]DX instead of DX
  1238. 3Fh [E]DX instead of DX
  1239. 40h [E]DX instead of DX
  1240. 41h [E]DX instead of DX
  1241. 43h [E]DX instead of DX
  1242. 44h sub function 02h, use [E]DX instead.
  1243. 44h sub function 03h, use [E]DX instead.
  1244. 44h sub function 04h, use [E]DX instead.
  1245. 44h sub function 05h, use [E]DX instead.
  1246. 47h [E]SI instead of SI
  1247. 48h Protected mode memory will be allocated.
  1248. 49h Protected mode memory will be released.
  1249. 4Ah Protected mode memory will be resized.
  1250. 4Bh [E]DX & [E]BX instead of DX & BX. Parameter block offset entries are w|d.
  1251. 4Eh [E]DX instead of DX
  1252. 56h [E]DX & [E]DI instead of DX & DI
  1253. 5Ah [E]DX instead of DX
  1254. 5Bh [E]DX instead of DX
  1255. 62h Protected mode selector will be returned.
  1256. 6Ch [E]SI instead of SI
  1257.  
  1258.  
  1259. INT 33h
  1260. -------
  1261.  
  1262. 09h [E]DX instead of DX.
  1263. 0Ch [E]DX instead of DX.
  1264. 16h [E]DX instead of DX.
  1265. 17h [E]DX instead of DX.
  1266.  
  1267. The size of register used will depend on the limit of the selector
  1268. supplied.  Unspecified registers should be set up in the normal way.
  1269.  
  1270.  
  1271. INT 23h
  1272. -------
  1273.  
  1274. This interrupt is always reflected back to the protected mode handler
  1275. to ensure your program can deal with it correctly.  The default handler
  1276. will abort your application in the same manner as DOS. If you need to
  1277. terminate your application in your own handler, perform an int 21h,
  1278. ah=4ch as normal.
  1279.  
  1280.  
  1281. INT 24h
  1282. -------
  1283.  
  1284. This interrupt is always reflected back to the protected mode handler
  1285. to ensure your program can deal with it correctly.  The default handler
  1286. behaves in the same way as the DOS handler, aborting your application
  1287. if appropriate.  If you install your own handler, all memory touched by
  1288. this interrupt must be locked.  The register values normally placed on
  1289. the stack by DOS before entry to the interrupt handler will not be
  1290. present in protected mode, only the register values will be valid.  You
  1291. may terminate your application from within this interrupt with int 21h,
  1292. ah=4ch as normal.
  1293.  
  1294.  
  1295.  
  1296. USING THE FLAT OR NEAR MODEL
  1297. ============================
  1298.  
  1299. If you declare a single 32-bit segment within your program and specify
  1300. a class of NEAR, any segment name references will assume a selector of
  1301. DATA is required. If you should need to reference the CODE selector,
  1302. load it from CS. The segment will be extended by either the default
  1303. stack size of 1K or the value specified by WL32's /ST option.  The
  1304. program's entry ESP value will be set to the end of this segment with
  1305. the entry SS value using the segment defined as 'near'. This means that
  1306. SS/ESP/EBP addressing will also be near.
  1307.  
  1308. For example,
  1309.  
  1310. A_SEGMENT  segment para 'near'
  1311.  
  1312.      mov  ax,A_SEGMENT   ;A selector with a type of DATA will be loaded.
  1313.      mov  ds,ax          ;Could get this value from SS instead though.
  1314.      mov  es,ax
  1315.      mov  fs,ax          ;Now all segment registers will map the same
  1316.      mov  gs,ax          ;region of memory and have a limit of 4G.
  1317.  
  1318. A_SEGMENT  ends
  1319.  
  1320. Only a single segment definition is allowed when a class of NEAR is
  1321. used.
  1322.  
  1323.  
  1324.  
  1325.      ==============
  1326.       WL32 LINKER
  1327.      ==============
  1328.  
  1329.  
  1330. USING WL32
  1331. ==========
  1332.  
  1333. Operate WL32 from the DOS command line or a batch or make file.  There
  1334. are no menus and operating modes.  You simply type WL32 followed by
  1335. your specific command options and one or more filenames.  WL32 will be
  1336. very familiar to users of Borland's TLink or Microsoft Link.
  1337.  
  1338. Use the following format for running WL32 from the DOS prompt:
  1339.  
  1340. WL32 [command options] OBJECT_FILES,[program_file],[map_file],[library_files]
  1341.  
  1342. WL32 uses default extensions for the object files, program file, map
  1343. file, and library files.  You may omit a file extension and WL32 will
  1344. look for a file by using the name given with the appropriate default
  1345. extension.
  1346.  
  1347. The default extension for various files are:
  1348.  
  1349. Program File   .EXE
  1350. Library File   .LIB
  1351. Map File       .MAP
  1352. Object File    .OBJ
  1353.  
  1354. You can override the default extension by the explicit use of a
  1355. different extension in the file name.
  1356.  
  1357. If no executable file name is listed, WL32 will use the first .OBJ file
  1358. name with a .EXE extension.  If no map file name is listed and the /m
  1359. option is specified, Wl32 will use the .EXE file name with a .MAP
  1360. extension.
  1361.  
  1362.  
  1363.  
  1364. RESPONSE FILES
  1365. ==============
  1366.  
  1367. You can store command options and file names that you entered on the
  1368. DOS command in a response file.  Response files are often referred to
  1369. as link files, command scripts, or script files.  Use response files to
  1370. ease repetitive linking tasks and to allow longer commands than can be
  1371. typed on the DOS command line.
  1372.  
  1373. See also the Configuration File chapter for more information on
  1374. response files.
  1375.  
  1376.  
  1377. Response File Format
  1378. --------------------
  1379.  
  1380. Use the following format for using a response file with WL32:
  1381.  
  1382. WL32 @FILENAME.EXT
  1383.  
  1384. The @ symbol designates the file as a response file instead of a .OBJ
  1385. file or .LIB file.  You may list more than one response file when
  1386. linking and can nest one response file inside another (this is most
  1387. useful when linking in freeformat mode described in the Configuration
  1388. File chapter).
  1389.  
  1390. The line length for a response file must be 125 characters or less.
  1391.  
  1392. When using response files, you must specify the file extension if one
  1393. is desired.  WL32 does not assume a .LNK or .RSP file extension.
  1394.  
  1395. Using A Response File
  1396. ---------------------
  1397.  
  1398. A response file contains exactly what you would type after WL32 on the
  1399. DOS command line.  To break up a response file into several lines in
  1400. default linker behavior (nonfreeformat), use a plus sign at the end of
  1401. the line for lists of .OBJ and .LIB files.
  1402.  
  1403. Comments In A Response File
  1404. ---------------------------
  1405.  
  1406. You can add comments to WL32's response files to help make them clearer
  1407. or for documentation purposes.  Use the pound sign (#) in a line to
  1408. insert comments into a response file.  All characters on a line after
  1409. the pound sign will be ignored by WL32.
  1410.  
  1411.  
  1412. CONFIGURATION FILES
  1413. ===================
  1414.  
  1415. WL32 supports linker script "morphing" commands.  Morphing capability
  1416. allows WL32 to read link files and scripts of any linker without
  1417. changing those files.  This includes both positional and freeformat
  1418. link files and scripts.
  1419.  
  1420. To use this feature, place the morphing commands in a linker
  1421. definitions file and specify the file through the /lc:<filename>
  1422. option.  With all morphing commands, case is significant and the linker
  1423. will return an error for a lowercase command.  However, case is not
  1424. significant for the <string> or <option> listing that is translated or
  1425. morphed into an instruction understood by WL32.  For example,
  1426. "LIB=LIBNAME" and "lib=LIBNAME" are valid linker definition file lines,
  1427. "LIB=libname" and "lib=libname" are not.  Only one definition may be
  1428. made per linker definition file line.
  1429.  
  1430. A '*' character at the end of <string> will instruct the linker to
  1431. ignore the entire response file or command line after processing
  1432. <string>.  This is most often used to ignore characters after a
  1433. superfluous command, such as MODULE.
  1434.  
  1435. '[' and ']' commands in a <string> have special meaning.  Characters
  1436. within a bracket are optional when parsing <string>.  If they are not
  1437. present, <string> will still be parsed correctly to the proper command.
  1438.  
  1439. Following are all currently supported morphing commands with a
  1440. description of their use:
  1441.  
  1442. <character>=TERMINATION
  1443. -----------------------
  1444.  
  1445. Specify one character to terminate linker processing.  Typically for
  1446. Microsoft Link users this will be ';'.  For example:
  1447.  
  1448. ;=TERMINATION
  1449.  
  1450. If more than one termination command line is listed, only the last one
  1451. specified will be used.
  1452.  
  1453.  
  1454. <character>=IGNORE
  1455. ------------------
  1456.  
  1457. Specify one character to ignore when adjacent to or part of a file name
  1458. in a linker response file or command line.  This allows ignoring
  1459. parentheses or brackets around overlaying file names without modifying
  1460. the script file.  Up to 16 ignore characters can be specified in
  1461. separate lines.  After 16 ignore characters are processed in the
  1462. definitions file, the 17th character listed will overwrite the first
  1463. ignore character stored, and so on.  The following two commands are
  1464. common with the IGNORE command:
  1465.  
  1466. (=IGNORE
  1467. )=IGNORE
  1468.  
  1469.  
  1470. <character>=COMMENT
  1471. -------------------
  1472.  
  1473. Specify one character that is recognized as a comment line in a linker
  1474. script file.  WL32 defaults to '#', but this command will allow
  1475. changing it to the comment character you desire.  If more than one
  1476. comment line is listed, only the last one specified will be used.
  1477.  
  1478.  
  1479. <WL32 option>=DEFAULT
  1480. ---------------------
  1481.  
  1482. Specify a WL32 that is on by default.  For example:
  1483.  
  1484. /b=DEFAULT
  1485.  
  1486.  
  1487. <string>=NULL
  1488. -------------
  1489.  
  1490. Any string of characters that should be ignored by the linker can be
  1491. specified in the definitions file using the NULL command.  A '*'
  1492. character at the end of <string> will instruct the linker to ignore the
  1493. entire response file or command line.  For example:
  1494.  
  1495. /DOSSEG=NULL
  1496.  
  1497. means ignore /DOSSEG in the linker script file or command line.  This
  1498. command:
  1499.  
  1500. MOD[ULE]*=NULL
  1501.  
  1502. means ignore the entire line starting with MODULE, with the "ULE"
  1503. characters optional.
  1504.  
  1505.  
  1506. FREEFORMAT
  1507. ----------
  1508.  
  1509. Switch the linker into freeformat parsing mode used by RTLink, PLink,
  1510. and Blinker as opposed to the positional format used by Microsoft Link,
  1511. TLink, WarpLink, and Symantec's BLink.  You cannot switch back to
  1512. positional parsing mode after entering freeformat.  Several linker
  1513. definition commands are only valid in freeformat mode.
  1514.  
  1515.  
  1516. <string>=OBJNAME
  1517. ----------------
  1518.  
  1519. Specify a string when in freeformat mode that tells WL32 it is parsing
  1520. a list of object modules.  This should the most common use with in the
  1521. definitions file with freeformat link files:
  1522.  
  1523. FI[LE]=OBJNAME
  1524.  
  1525.  
  1526. <string>=LIBNAME
  1527. ----------------
  1528.  
  1529. Specify a string when in freeformat mode that tells WL32 it is parsing
  1530. a list of libraries.  The following three commands should be the most
  1531. common in a definitions file with freeformat link files:
  1532.  
  1533. LIB[RARY]=LIBNAME
  1534. SEA[RCH]=LIBNAME
  1535. ALL[OCATE]=LIBNAME
  1536.  
  1537.  
  1538. <string>=EXENAME
  1539. ----------------
  1540.  
  1541. Specify a string when in freeformat mode that tells WL32 it is parsing
  1542. the executable file name.  In most cases, the following command line
  1543. will be used.
  1544.  
  1545. OUTPUT=EXENAME
  1546.  
  1547.  
  1548. <string>=<WL32 option>
  1549. ----------------------
  1550.  
  1551. Translate <string> to the WL32 option.  Most useful for when a linker
  1552. script has an option which directly corresponds to a WL32 option but is
  1553. formatted differently.  Following are a few examples:
  1554.  
  1555. STACK=/st:
  1556. VERBOSE=/i
  1557. /nod=/nd
  1558.  
  1559.  
  1560. <file name>=OBJADD
  1561. ------------------
  1562.  
  1563. Specify an object module that will always be linked into a program.
  1564. This file will be added as soon as it is encountered in the
  1565. configuration file, so if you list the configuration file before any
  1566. object modules and do not specify an EXE file name, the EXE file name
  1567. will be based on the object module file name in the first OBJADD.  If
  1568. the object module is not present in the current directory or found
  1569. using the OBJ environment variable, WL32 will terminate with a file not
  1570. found error.
  1571.  
  1572. This command is most useful for languages which need replacement object
  1573. modules to go along with the DOS extender.
  1574.  
  1575.  
  1576. <file name>=LIBADD
  1577. ------------------
  1578.  
  1579. Specify a library file that will always be linked into a program.  This
  1580. file will be added as soon as it is encountered in the configuration
  1581. file.  If the library file is not present in the current directory or
  1582. found using the LIB environment variable, WL32 will terminate with a
  1583. file not found error.
  1584.  
  1585. This command is most useful for languages which need replacement
  1586. libraries to go along with the DOS extender.
  1587.  
  1588.  
  1589. <file name>=FILEDELETE
  1590. ----------------------
  1591.  
  1592. Specify a file that will be removed from the link process if it
  1593. is encountered in a link file or command line.  The file will be
  1594. deleted even if it is listed with a drive or directory
  1595. specification in the link file.  Do not list <file name> with a
  1596. drive or directory specification.  <file name> must contain an
  1597. extension if the file to be removed has either an explicit or
  1598. default extension.  Multiple FILEDELETE commands are supported.
  1599.  
  1600. This command is most useful to removing superfluous object
  1601. modules or libraries from link files without directly editing
  1602. them.  For example, overlay managers and libraries are not
  1603. needed with the DOS extender and will only add unnecessary code
  1604. to the program, at best.  If your link files list an overlay
  1605. manager called OVLMGR.OBJ, the following command will remove it
  1606. from the link process:
  1607.  
  1608. OVLMGR.OBJ=FILEDELETE
  1609.  
  1610.  
  1611. Configuration File Examples
  1612. ---------------------------
  1613.  
  1614. Three sample definitions files have been included.  MSLINK.DEF will
  1615. ignore or translate several Microsoft Link options, WARPLINK.DEF will
  1616. do the same with WarpLink script files, and RTLINK.DEF will engage
  1617. freeformat parsing and translate or ignore commands.  The command lists
  1618. are not exhaustive, but do cover the most commonly used commands and
  1619. options by those, and compatible, linkers.  Definition files are
  1620. accessed via this format:
  1621.  
  1622. WL32 <definitions file> <link file>
  1623.  
  1624. as in WL32 /lc:RTLINK.DEF @LINKFILE.LNK.  Once a definitions file is
  1625. properly set for a particular link script style you need not modify any
  1626. of the link scripts associated with that linker.
  1627.  
  1628. You may use the /wu option to see which options or commands are being
  1629. ignored by the linker as unknown.
  1630.  
  1631. Note that the morphing ability allows you to set up link scripts that
  1632. are extremely opaque and impossible for other linkers to understand.
  1633. If you want your link file to look like line noise and still create a
  1634. real executable, it certainly is possible with the proper linker
  1635. definition file setup.  For example, create a configuration file with
  1636. the following commands:
  1637.  
  1638. FREEFORMAT
  1639. /COW=/ex
  1640. LINKTHISFILE=OBJNAME
  1641. MYFILE3=OBJADD
  1642. LINKTHISONETOO=OBJNAME
  1643. HEREARELIBRARIES=LIBNAME
  1644. IGNORE[THIS]*=NULL
  1645. /DOESNOTHINGBUTLONGIMPRESSIVELOOKINGOPTION*=NULL
  1646. @=IGNORE
  1647. -=IGNORE
  1648. "=IGNORE
  1649. MR-STACK=/st:
  1650. CREATE=EXENAME
  1651. ~=COMMENT
  1652. /b=DEFAULT
  1653.  
  1654. Using this configuration file, the following is a link file that links
  1655. together MYFILE.OBJ, MYFILE2.OBJ, MYFILE3.OBJ, MYLIB1.LIB, MYLIB2.LIB,
  1656. and MYLIB3.LIB, created a standard DOS EXE-format file name MYEXE.EXE
  1657. with a stack of 2K, beeping the speaker at the end of the link.
  1658.  
  1659. /COW LINKTHISFILE @@myfile--
  1660. LINKTHISONETOO -myfile2"
  1661. HEREARELIBRARIES @mylib1@ -mylib2- @mylib3- ~ 3 libraries
  1662. IGNORETHIS line altogether
  1663. /DOESNOTHINGBUTLONGIMPRESSIVELOOKINGOPTION
  1664. MR-STACK 2048
  1665. IGNORE as well
  1666. CREATE MYEXE ~ make EXE name MYEXE.EXE
  1667.  
  1668.  
  1669.  
  1670. WL32 OPTIONS
  1671. ============
  1672.  
  1673. WL32 options allow you to control how your programs are linked.  You
  1674. can specify these options from the DOS command line, in a batch or make
  1675. file, or in a response file.  If you are using the option morphing
  1676. feature described in the Configuration Files chapter, the options
  1677. listed may appear differently in your command line, or response or make
  1678. file.  The option format listed in this chapter, however, will always
  1679. be valid.
  1680.  
  1681. All options are case insensitive, e.g. both /b and /B refer to the beep
  1682. when link is complete option.  Enter WL32 without parameters at the DOS
  1683. command line for a summary of linker options.
  1684.  
  1685.  /b          Beep the speaker at linker completion
  1686.  
  1687. This option will cause WL32 to beep your speaker three times at the
  1688. completion of the linking process by writing three Control-G characters
  1689. to the standard output device.
  1690.  
  1691.  /ex         create DOS EXE-format file
  1692.  
  1693. This option instructs WL32 to create a standard DOS EXE-format file,
  1694. similar to those created by non-DOS extended linkers such as TLink or
  1695. Microsoft Link.  Creating a standard DOS EXE-format file will only work
  1696. for programs which do not exceed DOS's memory limit when fully loaded
  1697. into memory.  Medium to large-sized  programs which require a DOS
  1698. extender or overlays will probably not work when linked using the /ex
  1699. option.
  1700.  
  1701.  /i          display link process Information
  1702.  
  1703. This option provides information about the linker while it is working.
  1704. When this option is specified, WL32 displays the current file or
  1705. library module being processed and the segments being written to the
  1706. executable file, as well as identifying the start of major link phases.
  1707.  
  1708. The /i option may help you troubleshoot any problems that occur when
  1709. using WL32 by narrowing down where the trouble spot lies.  Technical
  1710. support will often request a redirected output of the link process when
  1711. using the /i option if you experience a problem in WL32.
  1712.  
  1713.  /il         display link process Information, Limit information
  1714.              displayed
  1715.  
  1716. This option is very similar to the /i option except that it only
  1717. displays the file being read and the major link phases.  The /i option
  1718. display is quite exhaustive and provides much more information than is
  1719. needed in many cases.  The /il option makes the information display
  1720. more manageable.  Also, because of the limited information display,
  1721. linker execution speed using the /il option is not so negatively
  1722. impacted as with the /i option.
  1723.  
  1724.  /lc:<name>  Link options Configuration file name
  1725.  
  1726. This /lc option supplies a configuration file name to WL32 for use with
  1727. the option morphing feature.  If no configuration file name is listed,
  1728. no option morphing will occur.  The configuration file must be in the
  1729. current directory or be listed with the drive and directory in which it
  1730. resides.  Multiple configuration files are allowed, they will be
  1731. processed in the order that they are encountered.
  1732.  
  1733.  /m          create MAP file
  1734.  
  1735. The /m option creates a map file.  This option is also set if a map
  1736. file name is explicitly listed in a linker response file or command
  1737. line.
  1738.  
  1739. Map files contain the size, name, and class of segments in the created
  1740. program, the time and date created, the name of the executable file,
  1741. and the program entry point.  They also list the names and addresses of
  1742. public symbols in the program.  This information is useful for
  1743. debugging your program and identifying space requirements for each
  1744. segment.  The CauseWay debugger CWD uses map files to display symbolic
  1745. addresses of the CauseWay executable file being debugged.
  1746.  
  1747.  /nd         do Not use Default library names in object modules
  1748.  
  1749. Most language compilers and assemblers insert the name of one or more
  1750. runtime libraries directly into their .OBJ files so that these
  1751. libraries do not have to be explicitly specifed on the linker command
  1752. line.  These .LIB files are called the default libraries.  You can
  1753. prevent WL32 from using the default libraries by using the /nd option.
  1754.  
  1755. The /nd option allows you to link program without automatically linking
  1756. in the default libraries.  This may be useful when linking in
  1757. replacement libraries or if you rename default libraries.
  1758.  
  1759.  /st:<size>  set program STack size in bytes
  1760.  
  1761. This option allows you to modify the linked program's stack size.  It
  1762. will override the default stack set by the programming language if the
  1763. default stack is smaller than the size specified by the /st option.
  1764. The value may range from 1 to 65535 bytes.
  1765.  
  1766. If no stack is set by this option or by the program, a default stack of
  1767. size 1K (1024 bytes) is created by WL32.  Executable programs should
  1768. always have a stack.
  1769.  
  1770.  /sy         create SYM file for CWD debugger
  1771.  
  1772. The /sy option is only useful when operating a CauseWay application
  1773. with the CWD debugger.  It creates a .SYM file containing information
  1774. on the public symbols within the application.  When using MAP files
  1775. with many public symbols, CWD may take a long time to process all of
  1776. the symbolic information.  The .SYM contains this information in an
  1777. optimized form, allow an application to load under CWD more quickly.
  1778. CWD will first check for a .SYM file, then use a .MAP file (if present)
  1779. for symbolic information if no .SYM file is available.
  1780.  
  1781. NOTE:  This option may noticeably affect WL32 link speed and should not
  1782. be specified if it is not needed.
  1783.  
  1784.  /w1         Warnings generate exit code of 1, not zero
  1785.  
  1786. Unlike errors, warnings do not normally generate a nonzero exit code
  1787. (also known as the DOS ERRORLEVEL or the return code) when WL32
  1788. finishes the link.  When the /w1 option is used, warnings will cause a
  1789. exit code of 1 rather than 0.  This can be useful for those who create
  1790. programs using make or batch files and wish to detect warning
  1791. conditions.
  1792.  
  1793.  /wu         issue Warning on Unknown linker options or commands
  1794.  
  1795. WL32 will normally ignore without feedback an unknown linker option or
  1796. command provided that the unknown text is not preceded by a '/'.  When
  1797. this option is set, all ignored text is listed by WL32.  This option is
  1798. most useful if you are using configuration files with the FREEFORMAT
  1799. option to detect when an unknown command or option is being bypassed by
  1800. WL32.
  1801.  
  1802.  
  1803.  
  1804.      ====================
  1805.       CAUSEWAY UTILITIES
  1806.      ====================
  1807.  
  1808.  
  1809. CAUSEWAY FILE COMPRESSOR
  1810. ========================
  1811.  
  1812. The CauseWay file compressor (CWC.EXE) compresses CauseWay format
  1813. applications to reduce their disk space consumption.
  1814.  
  1815. The command line should look like this:
  1816.  
  1817. CWC MYPROG
  1818.  
  1819. Where MYPROG is the name of the CauseWay executable file to compress.
  1820. If MYPROG has no extension .EXE will be appended.
  1821.  
  1822. Good compression should be achieved on most files with no noticeable
  1823. load time delay for the decompression.  Files that are mostly
  1824. executable code may load slightly slower than normal.  In the rare
  1825. event that load time becomes unacceptable, use of CWC should be
  1826. abandoned.
  1827.  
  1828. NOTE:  It is not possible to use a real mode standard DOS EXE-format
  1829. file compressor such as PKLITE or LZEXE on CauseWay applications.
  1830.  
  1831.  
  1832. CAUSEWAY SYMBOLIC DEBUGGER
  1833. ==========================
  1834.  
  1835. To use CWD.EXE, CWD.OVL must be present in the same directory as
  1836. CWD.EXE.  The command line should look like this:
  1837.  
  1838.  CWD [CWD OPTIONS] MYPROG [MYPROG COMMAND LINE]
  1839.  
  1840. where MYPROG.EXE is the program being debugged with CWD.  Notice that
  1841. the command line after MYPROG is passed to MYPROG as if that were all
  1842. that was provided. Any CWD options MUST be specified before MYPROG.
  1843.  
  1844. Options:
  1845.  
  1846. /dm      - CWD will use a mono monitor for its output.
  1847. /eSYMBOL - CWD will run the program until SYMBOL is reached.
  1848.            e.g., /e_main for C.
  1849.  
  1850. If a MYPROG.MAP file exists CWD searches it for a list of symbols to
  1851. improve readability of your application.  The CauseWay debugger
  1852. (CWD.EXE) only supports symbols found in a .MAP file.
  1853.  
  1854.  
  1855. CS:EIP Window
  1856. -------------
  1857.  
  1858. Most of the available keypresses are listed across the bottom of the
  1859. screen on the quick help bar. To move the current view use the cursor
  1860. keys but remember that this doesn't alter CS:EIP.
  1861.  
  1862. The current CS:EIP position is marked by a > symbol and also a green bar.
  1863.  
  1864. The current display position is marked by a blue bar.
  1865.  
  1866. Breakpoints are marked with a * symbol and a red bar.
  1867.  
  1868. F1-User     Displays the user/application screen.
  1869.  
  1870. F2-Break    Sets or resets a break point at the current view point.
  1871.  
  1872. F3-Goto     Moves the display point to the expression specified when
  1873.             prompted.  Expression used may contain symbols, numbers or
  1874.             registers.  Segment & offset should be separated by a colon
  1875.             (:).  For example, SS:ESP and DS:80h are both valid
  1876.             expressions. It is not possible to specify a register AND a
  1877.             numeric/symbolic expression for the offset, eg, EBP+10h.
  1878.  
  1879. ALT-F3      Displays a list of symbols. Highlight the symbol you want
  1880.             to move the display to and press enter. Symbols are listed
  1881.             with names on the left and values on the right. The C or D
  1882.             displayed adjacent to the value indicates the address type
  1883.             is CODE or DATA.  A speed search is available by typing
  1884.             the desired symbol text.
  1885.  
  1886. F4-Here     Executes instructions until the current view position is
  1887.             reached.
  1888.  
  1889. F5-Data     Opens a data window with default assignments.
  1890.  
  1891. F6-Skip     Steps CS:EIP over the current instruction without executing
  1892.             it.
  1893.  
  1894. F7-Trace    Executes the next instruction only.
  1895.  
  1896. F8-Step     Executes instructions until the next instruction is
  1897.             reached.
  1898.  
  1899. F9-Run      Starts normal execution which will continue until either
  1900.             the program terminates or a breakpoint condition is
  1901.             satisfied.
  1902.  
  1903. F10-Flip    Toggles the display flipping method between fast (default)
  1904.             and complete (slow). Use complete mode when debugging
  1905.             applications that change the screen mode.
  1906.  
  1907. +           When on a break point this will increment the breakpoint's
  1908.             trigger count.
  1909.  
  1910. -           When on a break point this will decrement the breakpoint's
  1911.             trigger count.
  1912.  
  1913. ALT-X       Exit to DOS.
  1914.  
  1915.  
  1916. Data #?? Window
  1917. ---------------
  1918.  
  1919. Most of the available keypresses are listed across the bottom of the
  1920. screen on the quick help bar. Use the cursor keys to move around the
  1921. display and keys '0' to '9' and 'A' to 'F' to change values in any of
  1922. the hex display formats. The text display format will allow any value
  1923. to be entered, including using ALT and the numeric keypad to generate
  1924. values.
  1925.  
  1926. F1-Address  Toggles display of address down left of window.
  1927.  
  1928. F3-Goto     Moves the display point to the expression specified when
  1929.             prompted.  Expression used may contain symbols, numbers or
  1930.             registers.  Segment & offset should be seperated by a colon
  1931.             (:). If a register is used then the display will track that
  1932.             register.  eg, SS:ESP is a valid expression as is DS:80h.
  1933.             It is not possible to specify a register AND a
  1934.             numeric/symbolic expression for the offset, eg, EBP+10h.
  1935.  
  1936. ALT-F3      Displays a list of symbols. Highlight the symbol you want
  1937.             to move the display to and press enter. Symbols are listed
  1938.             with names on the left and values on the right. The C or D
  1939.             displayed adjacent to the value indicates the address type
  1940.             is CODE or DATA.  A speed search is available by typing
  1941.             the desired symbol text.
  1942.  
  1943. F4-Bytes    Display list of bytes.
  1944.  
  1945. F5-Words    Display list of words.
  1946.  
  1947. F6-Dwords   Display list of dwords.
  1948.  
  1949. F7-Text     Display ASCII string.
  1950.  
  1951. F8-Mixed    Display list of bytes followed by a list of ASCII
  1952.             representations.
  1953.  
  1954. F10-Close   Closes the Data window.
  1955.  
  1956. ALT-X       Exit to DOS.
  1957.  
  1958.  
  1959. Register Window
  1960. ---------------
  1961.  
  1962. Most of the available keypresses are listed across the bottom of the
  1963. screen on the quick help bar. Use the cursor keys to move around the
  1964. display and keys '0' to '9' and 'A' to 'F' to change values
  1965.  
  1966. F3-Expr     Allows entry of an expression to set register value.
  1967.  
  1968. ALT-F3      Displays a list of symbols. Highlight the symbol you want
  1969.             to move the display to and press enter. Symbols are listed
  1970.             with names on the left and values on the right. The C or D
  1971.             displayed adjacent to the value indicates the address type
  1972.             is CODE or DATA.  A speed search is available by typing
  1973.             the desired symbol text.  Using this function on EIP will
  1974.             also set CS and move the CS:EIP window to the chosen
  1975.             address.
  1976.  
  1977. +           Increments the current register value.
  1978.  
  1979. -           Decrements the current register value.
  1980.  
  1981. ALT-X       Exit to DOS.
  1982.  
  1983.  
  1984. General
  1985. -------
  1986.  
  1987. Selecting any window other than the current foreground window with the
  1988. mouse will bring it to the foreground and make it the current focus.
  1989. The mouse button will have to be released again before further
  1990. selections can be made.
  1991.  
  1992. Selecting the title bar of the foreground window and holding the mouse
  1993. button down will allow you to move the window.
  1994.  
  1995. Selecting the bottom right corner of the current window will allow you
  1996. to adjust the windows size.
  1997.  
  1998. TAB cycles through available windows.
  1999.  
  2000. SHIFT-TAB cycles through windows in reverse order.
  2001.  
  2002. Applications that make use of graphics modes may prove difficult to
  2003. debug without a monochrome monitor. Mode 13h is directly supported but
  2004. with the proliferation of SVGA mode usage it is not really viable to
  2005. offer support for all modes likely to be encountered so a monochrome
  2006. monitor is really a must for those applications.
  2007.  
  2008.  
  2009.  
  2010. WARPWRAP ENVIRONMENT VARIABLE BURN-IN UTILITY
  2011. =============================================
  2012.  
  2013. WARPWRAP Introduction
  2014. ---------------------
  2015.  
  2016. WARPWRAP (WW.EXE) is a utility that allows control over the environment
  2017. variables accessible by an EXE program, as well giving the ability to
  2018. set uninitialized memory to a particular value upon program startup.
  2019. Environment variables can be preset to a particular value, deleted if
  2020. already present, or added if they do not already exist.  All of this is
  2021. under the control of the individual creating the EXE program, without
  2022. enduser intervention or the need for batch files.
  2023.  
  2024. WARPWRAP works by modifying an EXE file, adding code that is
  2025. immediately called when the EXE file is loaded by DOS.  This code
  2026. changes the program's environment variable block (if necessary) to
  2027. contain settings specified by the WARPWRAP user, and optionally sets
  2028. uninitialized memory to a selected value.  The code then transfers
  2029. operation back to the original program without the enduser noticing any
  2030. difference from normal EXE operation.  In effect, WARPWRAP "wraps" a
  2031. seamless shell around the EXE file to achieve these results.
  2032.  
  2033.  
  2034. Using WARPWRAP
  2035. --------------
  2036.  
  2037. WARPWRAP operates in two different ways.  The simplest and least
  2038. powerful is to specify one environment variable that you want to be
  2039. added, or replaced, on the command line with the EXE file name to be
  2040. modified.  The environment variable setting comes first and is prefixed
  2041. with a "!" to differentiate the setting from an EXE or definition file
  2042. name, described later.
  2043.  
  2044. For example:
  2045.  
  2046. WW !COW=MOO MYPROG
  2047.  
  2048. would always present the environment variable setting COW=MOO to
  2049. MYPROG.EXE as if the user had typed SET COW=MOO prior to running the
  2050. program.  If the environment variable COW previously existed with a
  2051. different setting, for example COW=MILK, it would be changed to
  2052. COW=MOO.  If it did not previously exist, it would be created.  No
  2053. other environment variables are modified.  Note that the .EXE extension
  2054. on the EXE file name is optional.
  2055.  
  2056. This first mode of operation allows replacing only one environment
  2057. variable, similar to the burn-in capabilities of other products.  There
  2058. is a second mode of WARPWRAP operation that allows replacing multiple
  2059. environment variables, as well as other tasks.
  2060.  
  2061. In the second mode, WARPWRAP users may specify a definition or script
  2062. file to list the environment variable and memory setting manipulations
  2063. desired.  The definition file is preceded with a "@".  A default
  2064. extension of .DEF is assigned if none is given by the user.
  2065.  
  2066. For example:
  2067.  
  2068. WW @STUFF MYPROG
  2069.  
  2070. will use the contents of the definition file STUFF.DEF to modify the
  2071. environment variables passed to MYPROG.EXE.
  2072.  
  2073. If no environment setting or definition file name is listed, that is,
  2074. no "!" or "@" text precedes an EXE file name, WARPWRAP defaults to
  2075. using a definitions file called WARPWRAP.DEF.  If that file does not
  2076. exist, WARPWRAP will abort processing.
  2077.  
  2078. For example:
  2079.  
  2080. WW MYPROG
  2081.  
  2082. will use the contents of the definition file WARPWRAP.DEF to modify the
  2083. environment variables passed to MYPROG.EXE.
  2084.  
  2085. There are six commands that are recognized by WARPWRAP within a
  2086. definition file, in addition to environment variable settings.  All
  2087. commands are preceded with a "~".  They are as follows:
  2088.  
  2089. 1.  ~NEW.  All environment variables on subsequent lines of the
  2090. definition file will be added to the EXE file environment block ONLY if
  2091. they do not already exist.  If the environment variable already exists,
  2092. regardless of setting, then there will be no change.  ~NEW environment
  2093. variables must have a setting or else WARPWRAP will abort with an error
  2094. at the incorrect line.  ~NEW stays in effect for all following
  2095. environment variables until a ~REPLACE or ~DELETE command is
  2096. encountered.
  2097.  
  2098. 2.  ~REPLACE.  All environment variables on subsequent lines of the
  2099. definition file will be added to the EXE file environment block
  2100. REGARDLESS of whether they already exist or not.  If they already
  2101. exist, they will be replaced.  ~REPLACE environment variables must have
  2102. a setting or else WARPWRAP will abort with an error at the incorrect
  2103. line.  ~REPLACE stays in effect for all following environment variables
  2104. until a ~NEW or ~DELETE command is encountered.  ~REPLACE is the
  2105. default condition in a definition file if no other command is present,
  2106. as if the definitions file started with a ~REPLACE command.
  2107.  
  2108. 3.  ~DELETE.  All environment variables on subsequent lines of the
  2109. definition file that match a pre-existing environment variable will be
  2110. removed from the EXE file environment block.  If a ~DELETE environment
  2111. variable is specified but does not exist, then the ~DELETE command is
  2112. ignored for that variable without error.  ~DELETE environment variables
  2113. must NOT have a setting or else WARPWRAP will abort with an error at
  2114. the incorrect line.  ~DELETE stays in effect for all following
  2115. environment variables until a ~NEW or ~REPLACE command is encountered.
  2116.  
  2117. 4.  ~SAVECASE.  By default, all environment variables and their
  2118. settings are changed to uppercase.  The ~SAVECASE command directs
  2119. WARPWRAP to keep the exact case of all following environment variables.
  2120.  
  2121. 5.  ~NOSAVECASE.  The ~NOSAVECASE commands restores WARPWRAP to its
  2122. default operation of changing environment variables and their setting
  2123. to uppercase.
  2124.  
  2125. 6.  ~CLEAR.  The ~CLEAR command directs WARPWRAP to clear all
  2126. uninitialized memory owned by the program to zero or the hexadecimal
  2127. value optionally listed following the ~CLEAR command.  If no value is
  2128. listed, then zero is used.  Memory is initialized in 2-byte (word)
  2129. increments, so the value may range from 0 to FFFF.  Invalid values will
  2130. result in either a zero value or an overflow setting of unknown value
  2131. used to clear memory.
  2132.  
  2133. Any line in a definition file which begins with a '#' is a comment
  2134. line.  Such lines are ignored by WARPWRAP when processing and are
  2135. useful for inserting remarks about the definition file.
  2136.  
  2137. Environment variables can optionally be preceded with the text "SET",
  2138. mimicking the DOS prompt means of setting environment variables.  This
  2139. is most useful is you want to set environment variables that match a
  2140. WARPWRAP command without WARPWRAP interpreting the environment variable
  2141. setting as a command.
  2142.  
  2143. Definition files and WARPWRAP itself are only necessary when modifying
  2144. an EXE file.  After an EXE file has been modified, it can be
  2145. distributed without any WARPWRAP files.  All code and data to perform
  2146. the tasks specified by the WARPWRAP user are contained with the EXE
  2147. file.
  2148.  
  2149.  
  2150. WARPWRAP Examples
  2151. -----------------
  2152.  
  2153. The files SHOWEVAR.ASM and SHOWEVAR.OBJ allow testing of WARPWRAP's
  2154. operations.  SHOWEVAR.ASM is the source code to a small assembly
  2155. language program that displays the current environment variables passed
  2156. to it.  SHOWEVAR.ASM is simply for reference purposes on what the
  2157. SHOWEVAR program does and is not needed for testing WARPWRAP.
  2158.  
  2159. Link SHOWEVAR.OBJ to an actual executable to use with WARPWRAP.  Since
  2160. you cannot unmodify a modified EXE file, you must relink SHOWEVAR.OBJ
  2161. to try a new WARPWRAP setting.
  2162.  
  2163. The WARPWARP.DEF file demonstrates many of the features one might find
  2164. in a WARPWRAP definition file.  Since this is the default definition
  2165. file name, it can be used by WARPWRAP via either this command line:
  2166.  
  2167. WW <EXE program>
  2168.  
  2169. or explicitly specified like this:
  2170.  
  2171. WW @WARPWRAP <EXE program>
  2172.  
  2173. where <EXE program> is the name of the EXE file to modify.
  2174.  
  2175. The included WARPWRAP.DEF file also contains a few tips about using
  2176. definition files.
  2177.  
  2178.  
  2179. WARPWRAP Notes
  2180. --------------
  2181.  
  2182. Leading and trailing spaces are typically ignored by WARPWRAP, though
  2183. they are not allowed within an environment variable setting.  Multiple
  2184. commands or variables on the same line will be ignored after the first
  2185. one is parsed by WARPWRAP.
  2186.  
  2187. WARPWRAP should co-exist peacefully with other EXE-modifying programs
  2188. (e.g. PKLITE) as long as WARPWRAP is the final program used.  WARPWRAP
  2189. expects its data to exist at the very end of the EXE file.  If another
  2190. EXE-modifying program appends additional data at the end of the EXE
  2191. file after WARPWRAP has processed the EXE file, WARPWRAP will not
  2192. operate correctly.
  2193.  
  2194. Do not modify WW.EXE.  Data is embedded in the WW.EXE file and any
  2195. modifications will probably lead to program failure.
  2196.  
  2197. WARPWARP contains several error-checking features.  In the rare event
  2198. that an EXE file is too small to hold the environment variable
  2199. modifications and associated code, WARPWARP will abort the process with
  2200. an error.  WARPWRAP will also check for previous processing and abort
  2201. the process if an EXE file has already been processed by WARPWRAP.  You
  2202. cannot -- and would not want to -- process an EXE file more than once
  2203. with WARPWRAP.  To restore an EXE file to unprocessed status or to
  2204. change the WARPWRAP environment variables and memory clearing
  2205. information within an EXE file, you need to rebuild the EXE file.
  2206. Usually this simply consists of re-linking the program's object modules
  2207. and libraries to a new EXE.
  2208.  
  2209. WARPWRAP does not modify the master environment variable block changed
  2210. at the DOS prompt.  Only the environment variables inherited by running
  2211. programs are modified.
  2212.  
  2213. WARPWRAP and WARPWRAP processed files will only work under MS-DOS or
  2214. PC-DOS version 3.0 and higher, or compatible operating system.
  2215.  
  2216. You must list any environment variables that contain quotes in a
  2217. definition file rather than use the one string "!" mode.
  2218.  
  2219.  
  2220.  
  2221.      ======
  2222.       HELP
  2223.      ======
  2224.  
  2225.  
  2226. TROUBLESHOOTING
  2227. ===============
  2228.  
  2229. This chapter provides a description of error messages that may be
  2230. encountered when using CauseWay, frequently with suggested solutions to
  2231. correct the error.
  2232.  
  2233. DOS extender error messages are messages displayed by the DOS extender
  2234. when a CauseWay application is running.  This messages are always
  2235. followed by the DOS extender terminating the application.  All DOS
  2236. extender errors are fatal, they terminate operation of the CauseWay
  2237. application.
  2238.  
  2239. DOS Extender Error Messages And Return Values
  2240. ---------------------------------------------
  2241.  
  2242. 01 - "Unable to resize program memory block."
  2243.  
  2244.      Generated if DOS reports an error when CauseWay tries to resize
  2245.      its real mode memory block. As the block is always shrunk the only
  2246.      possible cause of this is corrupted MCB's. Will probably need to
  2247.      re-boot the system to correct this one.
  2248.  
  2249. 02 - "386 or better required."
  2250.  
  2251.      Generated if CauseWay is run on anything below a 386.  You need
  2252.      another machine to correct this.
  2253.  
  2254. 03 - "Non-standard protected mode program already active."
  2255.  
  2256.      Generated if the system is already operating under the control of
  2257.      another protected mode program which doesn't conform to either
  2258.      VCPI or DPMI standards. Will need to identify and remove the other
  2259.      application before CauseWay can run.
  2260.  
  2261. 04 - "DOS 3.1 or better required."
  2262.  
  2263.      Generated if DOS version is less than 3.1.  You will need to
  2264.      upgrade the DOS version to correct this.
  2265.  
  2266. 05 - "Not enough memory for CauseWay."
  2267.  
  2268.      Generated if the system doesn't have enough free physical memory
  2269.      for the CauseWay kernal code and data to be initialized. Memory
  2270.      will need to be free'd before CauseWay will run but it can be any
  2271.      of the types supported.
  2272.  
  2273. 06 - "VCPI failed to switch into protected mode."
  2274.  
  2275.      Generated if a VCPI server is detected and the server fails to
  2276.      switch into protected mode when requested. The only likely cause
  2277.      of this is a corrupted system so a re-boot will be needed to get
  2278.      CauseWay running.
  2279.  
  2280. 07 - "Unable to control A20."
  2281.  
  2282.      Generated if CauseWay detects an A20 line that doesn't respond to
  2283.      the control methods normally adopted. This may either be a
  2284.      hardware fault or a none standard system. Not much can be done to
  2285.      solve the former but installing an XMS driver should cure the later.
  2286.  
  2287. 08 - "Selector allocation error."
  2288.  
  2289.      Generated if DPMI refuses to allocate enough selectors for
  2290.      CauseWay to function. Removing other program(s) that are using
  2291.      DPMI should sort this one out.
  2292.  
  2293. 09 - "Unrecoverable exception. Program terminated."
  2294.  
  2295.      Generated if a none recoverable exception occures. This indicates
  2296.      a bug in the application and the register dump displayed with this
  2297.      message should help to track down the problem.
  2298.  
  2299. 10 - "Unable to find application to load."
  2300.  
  2301.      Generated if CauseWay is unable to find the application on the end
  2302.      of the normal .EXE file. This indicates a corrupted file and can
  2303.      only be cured by obtaining another copy of the application.
  2304.  
  2305. 11 - "DOS reported error while accessing application."
  2306.  
  2307.      Generated if any kind of error is detected while accessing the
  2308.      application file. This indicates a corrupted file and can only be
  2309.      cured by obtaining another copy of the application.
  2310.  
  2311. 12 - "Not enough memory to load application."
  2312.  
  2313.      Generated if CauseWay is unable to provide enough memory to load
  2314.      the application.  Memory and/or disk space will need to be freed
  2315.      before the application will run.
  2316.  
  2317. 13 - "DPMI failed to switch to protected mode."
  2318.  
  2319.      Generated if using a DPMI server and it fails to switch to
  2320.      protected mode.  If the DPMI server only supports multiple clients
  2321.      of the same type (16/32) then the problem is probably that
  2322.      different type applications are being run already. Will need to
  2323.      remove other DPMI application(s) before CauseWay will run.
  2324.  
  2325. 14 - "Memory structures destroyed. Program terminated."
  2326.  
  2327.      Generated if internal memory management structures become
  2328.      corrupted. This is caused by the application writing to memory
  2329.      regions it doesn't own and indicates a bug in the application.
  2330.      Will need an corrected version of the application to fix this one.
  2331.  
  2332.  
  2333. WL32 linker error and warning messages are messages displayed by the
  2334. WL32 protected mode linker when it is linking a CauseWay application.
  2335. Error messages are always immediately followed by WL32 terminating the
  2336. link.  Warning messages are nonfatal, they do not terminate the link
  2337. process.
  2338.  
  2339. WL32 Warning Messages
  2340. ---------------------
  2341.  
  2342. Symbol defined more than once: <symbol name>
  2343. Defined in <filename>, duplicated in <filename>
  2344.  
  2345. This situation occurs ina program that has two or more globally visible
  2346. symbols with the same name.  Renaming or making private (or local) one
  2347. of the symbols may solve this problem.  Also, check for two or more
  2348. listings of the same object module in the object module list.  The
  2349. first definition of the symbol has precedence over any definitions
  2350. which may follow.
  2351.  
  2352. Unresolved externally declared symbol: <symbol name>
  2353. Declared in <filename>
  2354.  
  2355. This message usually appears when a needed object module or library
  2356. file was not specified on the linker command line or when the name of a
  2357. function or procedure has been misspelled or not made publicly
  2358. accessible for another module's use.  Thie linker cannot find a symbol
  2359. needed by the program to resolve an external reference in a module.
  2360.  
  2361. Unknown linker option or command, ignored: <command or option text>
  2362.  
  2363. The linker has encountered text which it doesn't understand.  As long
  2364. as this text is not preceded by a '/', this condition is not fatal.
  2365. This warning message will only display if the /wu, warn on unknown
  2366. options, option is set.
  2367.  
  2368.  
  2369. WL32 Error Messages And Return Values
  2370. -------------------------------------
  2371.  
  2372. 143 - 32-bit segment in DOS EXE file: <file name>
  2373.  
  2374. CauseWay supports 32-bit segments.  Standard DOS does not.  You linked
  2375. with the /ex option and one of the segments in an object module was
  2376. flagged as 32-bit.  This will not work, you must create a DOS-extended
  2377. EXE file or change the segment to 16-bit.
  2378.  
  2379. 133 - Allocate memory attempt failed.  Probably out of virtual memory.
  2380.  
  2381. This error is most often caused when the virtual memory manager runs
  2382. out of conventional and extended memory and disk space is very low.
  2383. Free up more disk space or extended memory.
  2384.  
  2385. 135 - At least one object module file must be specified when linking.
  2386.  
  2387. One or more options and possibly an EXE file name, MAP file name, or
  2388. library files were listed in the linker command line or response file.
  2389. However, no object module was listed.  Supply at least one object
  2390. module file name when linking.
  2391.  
  2392. 136 - Bad object record type in <filename>, value <number>
  2393.  
  2394. CauseWay did not recognize an object record type in the file
  2395. <filename>.  The value of the unrecognized object record is listed as
  2396. <number>.
  2397.  
  2398. 142 - Bad or invalid library (.LIB) file format in <file name>
  2399.  
  2400. The library file listed has an unrecognizable format or is corrupted.
  2401. WL32 supports the industry standard Microsoft LIB format.  Proprietary
  2402. formats incompatible with this standard will not work with WL32.
  2403.  
  2404. 144 - Configuration file line length exceeds 125 characters in <file name>
  2405.  
  2406. Configuration files have no size limit, but the length of any particular
  2407. line in the file cannot be larger than 125 characters.  Reduce the size
  2408. of the offending line.
  2409.  
  2410. Variable - DOS error, value <number>, File: <file name> (<explanatory text>)
  2411.  
  2412. A DOS error has occured when linking.  The DOS error number is listed
  2413. after value.  If a file is associated with the DOS error it is listed
  2414. as well.  Several common DOS error have short explanatory text (e.g.
  2415. 'file not found') in parentheses at the end of the feedback.  Not all
  2416. DOS errors will have this explanatory text.
  2417.  
  2418. 128 - Internal linker error occurred during linking process, value <number>
  2419.  
  2420. WL32 misbehaved.  Either a badly corrupted object module has confused
  2421. Wl32 beyond its ability to gracefully recover or else you have
  2422. discovered an error in the linker.  If an error in the linker is
  2423. suspected, please call technical support for help.  The reported
  2424. <number> value will help technical narrow down where the error
  2425. occurred.
  2426.  
  2427. 145 - Invalid configuration file line: <line text>
  2428.  
  2429. 131 - Invalid option: <option text>
  2430.  
  2431. An invalid option or option setting was passed to WL32 either at the
  2432. DOS prompt or through a response file.  Refer to the WL32 options
  2433. chapter for a complete description of all valid WL32 options and their
  2434. allowed values.  This error most often occurs when a configuration file
  2435. "morphed" option does not match the option listed in a response file.
  2436.  
  2437. 129 - MS-DOS or PC-DOS version must be 3.0 or above.
  2438.  
  2439. You must use MS-DOS or PC-DOS version 3.0, or compatible, to operate
  2440. WL32.  Either upgrade the machine's version of DOS or link the program
  2441. on a different machine.
  2442.  
  2443. 139 - Object record length too large in <file name>
  2444.  
  2445. To protect against internal buffer overflow, WL32 checks for object
  2446. records that are extremely large.  Since the 4K size threshold is well
  2447. above that generated by any compiler or assembler under normal
  2448. conditions, this message will typically only occur when attempting to
  2449. link a corrupted or invalid object module.
  2450.  
  2451. 140 - Poorly formed object record in <file name>, value <number>
  2452.  
  2453. WL32 recognized the object record type, but the internal structure of
  2454. the object record deviated from expected behavior.  Probably due to
  2455. either an obsolete or brand new record type, or a corrupted object
  2456. module.  The number value can be used by technical support to narrow
  2457. down the record's problem.
  2458.  
  2459. 139 - Release memory attempt failed.
  2460.  
  2461. 134 - Resize memory attempt failed.  Probably out of virtual memory.
  2462.  
  2463. 130 - Response file line length exceeds 125 characters in <file name>
  2464.  
  2465. Response files have no size limit, but the length of any particular
  2466. line in the file cannot be larger than 125 characters.  Break up the
  2467. line, using '+' signs or repeating the command in a following line as
  2468. appropriate.
  2469.  
  2470. 132 - Response files nested more than 10 levels deep in <file name>
  2471.  
  2472. The number of response files supplied to WL32 has no effective limit,
  2473. but you cannot nest them deeper than ten levels.  Move the offending
  2474. response files out of the tenth nesting level.
  2475.  
  2476. 141 - Segment size exceeds 64K: <segment name>
  2477.  
  2478. A 16-bit segment has become larger than 64K after combination of the
  2479. same segment types.  You will either need to reduce the code or data
  2480. associated with that segment, or make the segment 32-bit.
  2481.  
  2482. Variable - Unknown error occurred during linking process.
  2483.  
  2484. This message should never appear.  It means that an error has
  2485. snuck past WL32's normal error-reporting routines and the
  2486. feedback display routines have no idea what manner of error
  2487. occured.
  2488.  
  2489. 137 - Unsupported object record type in <file name>, value <number>
  2490.  
  2491. CauseWay recognizes this object record type, but cannot process it.
  2492. The most common reason for this feedback is an obsolete record type
  2493. created by a very old or nonstandard compiler or assembler.  If
  2494. possible, inhibit generation of the unsupported object record type.
  2495.  
  2496.  
  2497.  
  2498.      ============
  2499.       APPENDICES
  2500.      ============
  2501.  
  2502.  
  2503. APPENDIX A   Rules For Protected Mode Operation
  2504. ===============================================
  2505.  
  2506. Using protected mode does mean some simple rules need to be followed to
  2507. prevent processor faults from being generated.  These processor faults
  2508. occur when an application breaks protected mode programming rules.
  2509. These rules are:
  2510.  
  2511. 1.  A selector value (referred to as a segment value in real mode)
  2512.     loaded into a segment register references an area of memory that
  2513.     may occur anywhere within the physical address space.  This area of
  2514.     memory can be dynamically moved around by the operating system.
  2515.     Therefore, when dealing with selector values:
  2516.  
  2517.     a. Never use segment registers as general purpose registers that
  2518.        can be loaded with arbitrary values.  Every time a segment
  2519.        register is loaded with a value the processor checks to make
  2520.        sure it is a valid selector value and generates a fault if it is
  2521.        not.
  2522.  
  2523.     b. Never perform segment arithmatic on a selector value.  This is
  2524.        done in real mode code to either normalize a pointer or to
  2525.        access a single area of memory that is greater than 64K in size.
  2526.  
  2527.     c. All selectors have a size associated with them and attempts to
  2528.        access data at an offset greater than that size will result in a
  2529.        fault.  This is one of the greatest strengths of a DOS Extender
  2530.        because most obscure bugs in real mode code occur when a bad
  2531.        pointer is used.
  2532.  
  2533.     d. Segment registers can be loaded with a value of 0 but do not
  2534.        attempt to write to or read from a NULL (zero value) pointer or
  2535.        a fault will be generated.
  2536.  
  2537. 2.  You cannot execute code in a data segment and you cannot write to
  2538.     data in the code segment.  If you absolutely need to do this, use
  2539.     the CauseWay AliasSel function to map a data selector to the same
  2540.     physical memory area shared by a code selector.  Even in this case,
  2541.     however, you can never write to memory using a cs: override.
  2542.  
  2543. 3)  CauseWay handles most of the standard DOS interrupts transparently,
  2544.     but when passing pointers to buffers for software interrupt calls
  2545.     not handled transparently by CauseWay, the buffers must exist in
  2546.     low DOS memory.  In addition, the pointers must be converted from
  2547.     protected mode selector:offset pairs to real mode segment:offset
  2548.     pairs.
  2549.  
  2550.  
  2551.  
  2552. APPENDIX B   CauseWay File Format
  2553. =================================
  2554.  
  2555. This section describes the executable file format used by CauseWay.  It
  2556. is provided for reference only.
  2557.  
  2558. Main header
  2559. -----------
  2560.  
  2561.   NewHeaderStruc   struc
  2562.   NewID            db '3P'     ;identifier.
  2563.   NewSize          dd 0        ;byte size of header data.
  2564.   NewLength        dd 0        ;byte size of exe image data.
  2565.   NewAlloc         dd 0        ;byte size of program memory needed.
  2566.   NewSegments      dw 0        ;number of segment definitions.
  2567.   NewRelocs        dd 0        ;number of relocation table entries.
  2568.   NewEntryEIP      dd 0        ;entry offset.
  2569.   NewEntryCS       dw 0        ;segment list entry number for entry CS.
  2570.   NewEntryESP      dd 0        ;ESP offset.
  2571.   NewEntrySS       dw 0        ;segment list entry number for SS.
  2572.   NewEntryFlags    dd 0        ;Control flags.
  2573.   NewEntryAutoESP  dd 0        ;Automatic stack size if ESP entry = 0.
  2574.   NewNameLen       db 0         ;Length of name if any.
  2575.   NewEntryReserved db 64-NewEntryReserved dup (0)
  2576.   NewHeaderStruc   ends
  2577.  
  2578.  
  2579. Bits in NewEntryFlags:
  2580.  
  2581.   0 - 16-bit interrupt stack frame if set.
  2582.   7 - Descriptor table type. 0 - GDT, 1 - LDT.
  2583.  14 - 16-bit default for application segments D bit if set.
  2584.  31 - EXE image is compressed.
  2585.  
  2586.  Note that bits 0 & 14 should always have the same value.
  2587.  
  2588. Followed by:
  2589.  
  2590. Segment definition * NewSegments
  2591. --------------------------------
  2592.  
  2593. dword - Start offset within program.
  2594. dword - Length + type
  2595.           0-19  Length.
  2596.           20    Length granularity. If set then real length is
  2597.                 Length*4096 otherwise Length is byte granular.
  2598.           21-24 Type.
  2599.                 00=Code
  2600.                 01=Data
  2601.                 02=Stack
  2602.                 03=Read only data.
  2603.                 Remaining values reserved.
  2604.  
  2605.           25-Force segment D bit to 0. Overides default size in 3P flags.
  2606.           26-Force segment D bit to 1. Overides default size in 3P flags.
  2607.  
  2608.           Remaining bits reserved.
  2609.  
  2610. Followed by:
  2611.  
  2612. Relocation entry * NewRelocs
  2613. ----------------------------
  2614.  
  2615. dword - Offset within program of relocation item. The word indicated
  2616.         by this offset holds the segment number as listed in the
  2617.         segment definitions starting at 0 (This is where real mode
  2618.         normally has a segment offset from program start, eg, value of
  2619.         _DATA).
  2620.  
  2621. Followed by:
  2622.  
  2623. NewLength bytes of program image
  2624. --------------------------------
  2625.  
  2626. Followed by:
  2627.  
  2628. NewNameLen bytes of ASCII name text
  2629. -----------------------------------
  2630.